hanchenye-llvm-project/clang/test/SemaTemplate
Serge Pavlov 7dcc97e7ac Warn if function or variable cannot be implicitly instantiated
With this patch compiler emits warning if it tries to make implicit instantiation
of a template but cannot find the template definition. The warning can be suppressed
by explicit instantiation declaration or by command line options
-Wundefined-var-template and -Wundefined-func-template. The implementation follows
the discussion of http://reviews.llvm.org/D12326.

Differential Revision: http://reviews.llvm.org/D16396

llvm-svn: 266719
2016-04-19 06:19:52 +00:00
..
ackermann.cpp
address-spaces.cpp
alias-church-numerals.cpp
alias-nested-nontag.cpp
alias-template-template-param.cpp
alias-templates.cpp PR14858: Initial support for proper sizeof... handling within alias templates. 2015-09-23 21:41:42 +00:00
alignas.cpp
ambiguous-ovl-print.cpp
anonymous-union.cpp PR6037 2015-01-19 01:44:02 +00:00
array-to-pointer-decay.cpp
atomics.cpp
attributes.cpp
canonical-expr-type-0x.cpp
canonical-expr-type.cpp Preserve numeric literal suffixes during type canonicalization. 2014-11-20 03:37:32 +00:00
class-template-ctor-initializer.cpp [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
class-template-decl.cpp Test for diagnostic quality improvement in r256049. 2015-12-19 03:12:14 +00:00
class-template-id-2.cpp
class-template-id.cpp PR10405 - Desugar FunctionType and TemplateSpecializationType if any type that appears inside needs to be desugared. 2015-07-16 01:06:17 +00:00
class-template-spec.cpp Lit C++11 Compatibility Patch #7 2016-04-13 20:00:45 +00:00
constexpr-instantiate.cpp
constructor-template.cpp [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
copy-ctor-assign.cpp
crash-8204126.cpp
crash-10438657.cpp Ensure all TypoExprs are diagnosed by the tree transform. 2014-11-20 22:06:44 +00:00
crash-unparsed-exception.cpp [SemaTemplate] Detect instantiation of unparsed exceptions. 2015-07-25 01:19:32 +00:00
crash.cpp PR17730: Add test that we don't crash on this testcase. (The bug is already fixed.) 2014-10-28 17:00:19 +00:00
current-instantiation.cpp
cxx1z-fold-expressions.cpp Implement P0036R0: remove support for empty unary folds of +, *, |, &. 2016-03-04 21:27:21 +00:00
deduction-crash.cpp
deduction.cpp Implement [temp.deduct.type]p6: if the nested-name-specifier of a type is 2015-12-30 20:56:05 +00:00
default-arguments-cxx0x.cpp Fix assertion failure on MaybeODRUseExprs. 2016-02-24 23:05:43 +00:00
default-arguments.cpp Fix PR26134: When substituting into default template arguments, keep CurContext unchanged. 2016-01-19 03:58:55 +00:00
default-expr-arguments-2.cpp
default-expr-arguments.cpp [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
delegating-constructors.cpp
dependent-base-classes.cpp
dependent-base-member-init.cpp
dependent-class-member-operator.cpp
dependent-expr.cpp
dependent-names-no-std.cpp
dependent-names.cpp Weaken an assertion that isn't true for invalid input. 2015-01-30 01:48:49 +00:00
dependent-sized_array.cpp
dependent-template-recover.cpp
dependent-type-identity.cpp Improve the error message for assigning to read-only variables. 2015-04-11 01:53:13 +00:00
derived.cpp [Sema] Be consistent about diagnostic wording: always use "cannot". 2015-08-15 15:23:14 +00:00
destructor-template.cpp Sema: Recover when a function template is in an extern "C" block 2015-01-15 07:04:38 +00:00
elaborated-type-specifier.cpp
enum-argument.cpp
enum-bool.cpp Use APSInt::isSameValue instead of operator== in a place where two APSInt's 2015-01-09 00:58:16 +00:00
enum-forward.cpp
example-typelist.cpp
exception-spec-crash.cpp
explicit-instantiation.cpp Don't drop attributes when checking explicit specializations. 2014-12-19 23:52:45 +00:00
explicit-specialization-member.cpp Fix crash-on-invalid and name lookup when recovering from ~X::X() typo. 2015-01-15 00:48:52 +00:00
ext-vector-type.cpp
ext_ms_template_spec.cpp [MSVC] Explicit specializations can be declared in any namespace (fix for http://llvm.org/PR13738) 2015-03-20 07:21:46 +00:00
extension-sfinae.cpp
extern-templates.cpp
fibonacci.cpp
friend-template.cpp
friend.cpp Use the most recent previous decl to check if inline is added after a definition 2015-04-08 00:04:47 +00:00
fun-template-def.cpp [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
function-template-specialization-noreturn.cpp Don't drop attributes when checking explicit specializations. 2014-12-19 23:52:45 +00:00
function-template-specialization.cpp
implicit-instantiation-1.cpp
inject-templated-friend-post.cpp
inject-templated-friend.cpp
injected-class-name.cpp DR1909: Diagnose all invalid cases of a class member sharing its name with the class. 2015-07-06 01:45:27 +00:00
instantiate-anonymous-union.cpp
instantiate-array.cpp
instantiate-attr.cpp
instantiate-c99.cpp
instantiate-call.cpp
instantiate-case.cpp
instantiate-cast.cpp Lit C++11 Compatibility Patch #7 2016-04-13 20:00:45 +00:00
instantiate-clang.cpp
instantiate-complete.cpp
instantiate-decl-dtor.cpp
instantiate-decl-init.cpp
instantiate-declref-ice.cpp
instantiate-declref.cpp
instantiate-deeply.cpp
instantiate-default-assignment-operator.cpp
instantiate-dependent-nested-name.cpp Revert "Don't build invalid AST nodes during recovery" 2014-12-18 18:17:42 +00:00
instantiate-elab-type-specifier.cpp
instantiate-enum-2.cpp
instantiate-enum.cpp
instantiate-exception-spec-cxx11.cpp Instantiate function declarations in instantiated functions. 2015-08-23 10:22:28 +00:00
instantiate-exception-spec.cpp Instantiate exception specifications when instantiating function types (other 2014-11-12 02:00:47 +00:00
instantiate-explicitly-after-fatal.cpp Fix crash-on-invalid bug in template instantiation. 2015-06-26 02:15:04 +00:00
instantiate-expr-1.cpp Fix tests Clang::Sema/statements.c and Clang::SemaTemplate/instantiate-expr-1.cpp when AArch64 is the default target. 2014-08-04 10:13:09 +00:00
instantiate-expr-2.cpp
instantiate-expr-3.cpp Support __builtin_ms_va_list. 2015-09-17 20:55:33 +00:00
instantiate-expr-4.cpp Lit C++11 Compatibility Patch #7 2016-04-13 20:00:45 +00:00
instantiate-expr-5.cpp
instantiate-expr-6.cpp Revert r107690 (for PR7417) and add a testcase that it breaks. The approach of 2015-10-05 20:05:21 +00:00
instantiate-expr-basic.cpp
instantiate-field.cpp
instantiate-friend-class.cpp
instantiate-function-1.cpp
instantiate-function-1.mm
instantiate-function-2.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
instantiate-function-params.cpp
instantiate-init.cpp Handle use of default member initializers before end of outermost class 2014-11-17 23:36:45 +00:00
instantiate-invalid.cpp
instantiate-local-class.cpp Correctly type-check the default arguments of local functions 2015-12-11 01:56:36 +00:00
instantiate-member-class.cpp Lit C++11 Compatibility Patch #7 2016-04-13 20:00:45 +00:00
instantiate-member-expr.cpp
instantiate-member-initializers.cpp
instantiate-member-pointers.cpp
instantiate-member-template.cpp
instantiate-method.cpp Sema: RecordDecl shouldn't have a FunctionDecl as a Decl 2015-01-09 07:36:13 +00:00
instantiate-non-dependent-types.cpp Update error message text. 2015-01-18 19:05:48 +00:00
instantiate-non-type-template-parameter.cpp
instantiate-objc-1.mm
instantiate-overload-candidates.cpp
instantiate-overloaded-arrow.cpp
instantiate-partial-spec.cpp
instantiate-scope.cpp Don't forget to substitute into the qualifier when instantiating the definition 2014-10-17 20:37:29 +00:00
instantiate-self.cpp
instantiate-sizeof.cpp Add missing triple to instantiate-sizeof.cpp test 2016-03-11 19:17:53 +00:00
instantiate-static-var.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
instantiate-subscript.cpp
instantiate-template-template-parm.cpp
instantiate-try-catch.cpp
instantiate-type.cpp
instantiate-typedef.cpp
instantiate-typeof.cpp [C++11] Support for capturing of variable length arrays in lambda expression. 2014-08-28 04:28:19 +00:00
instantiate-using-decl.cpp Re-land r250592 without rejecting field refs in unevaluated contexts 2015-10-20 21:04:13 +00:00
instantiate-var-template.cpp PR24483: Delete some dead/incorrect code that triggered assertions. 2015-08-20 20:45:25 +00:00
instantiation-backtrace.cpp
instantiation-default-1.cpp
instantiation-default-2.cpp
instantiation-default-3.cpp
instantiation-depth-defarg.cpp
instantiation-depth-exception-spec.cpp
instantiation-depth-subst-2.cpp
instantiation-depth-subst.cpp
instantiation-depth.cpp
instantiation-order.cpp
issue150.cpp
lookup-dependent-bases.cpp Limit our MSVC compat hack for nested names from dependent bases 2014-08-14 23:34:52 +00:00
member-access-ambig.cpp
member-access-expr.cpp Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
member-function-template.cpp
member-inclass-init-value-dependent.cpp
member-initializers.cpp
member-template-access-expr.cpp
metafun-apply.cpp
missing-class-keyword-crash.cpp
ms-class-specialization-class-scope.cpp
ms-class-specialization-duplicate.cpp
ms-delayed-default-template-args.cpp
ms-function-specialization-class-scope.cpp
ms-if-exists.cpp
ms-lookup-template-base-classes.cpp [modules] Don't try to use the definition of a class if 2015-12-18 22:19:11 +00:00
ms-sizeof-missing-typename.cpp
nested-incomplete-class.cpp
nested-linkage.cpp
nested-name-spec-template.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
nested-template.cpp
operator-function-id-template.cpp
operator-template.cpp
overload-candidates.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
overload-uneval.cpp
overloaded-functions.cpp When checking the template argument list, use a copy of that list for changes 2015-01-24 02:48:32 +00:00
pack-deduction.cpp PR14615: add (passing) tests for this already-fixed bug 2014-07-22 23:56:53 +00:00
partial-spec-instantiate.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
pragma-ms_struct.cpp
qualified-id.cpp
qualified-names-diag.cpp [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
rdar9173693.cpp Revert "Improve declaration / expression disambiguation around ptr-operators, and use" 2015-02-23 22:36:28 +00:00
recovery-crash.cpp Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
recursive-template-instantiation.cpp
resolve-single-template-id.cpp
self-comparison.cpp
temp.cpp
temp_arg.cpp
temp_arg_enum_printing.cpp Pretty print support for template arg enum constants 2014-12-13 04:31:07 +00:00
temp_arg_nontype.cpp
temp_arg_nontype_cxx1z.cpp PR24921: checking explicitly-specified template arguments when matching a 2015-10-02 00:49:37 +00:00
temp_arg_nontype_cxx11.cpp Take the canonical type when forming a canonical template argument with 2014-07-24 02:27:39 +00:00
temp_arg_template.cpp Fix assert hit when tree-transforming template template parameter packs. 2016-01-11 11:39:00 +00:00
temp_arg_type.cpp Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
temp_class_order.cpp
temp_class_spec.cpp
temp_class_spec_blocks.cpp
temp_class_spec_neg.cpp [Lit Test] Updated 26 Lit tests to be C++11 compatible. 2015-11-11 19:34:47 +00:00
temp_explicit.cpp
temp_explicit_cxx0x.cpp
temp_func_order.cpp
template-class-traits.cpp
template-decl-fail.cpp
template-id-expr.cpp Fix a crash on invalid with template handling 2016-04-05 21:13:54 +00:00
template-id-printing.cpp
typename-specifier-2.cpp
typename-specifier-3.cpp
typename-specifier-4.cpp [Lit Test] Updated 26 Lit tests to be C++11 compatible. 2015-11-11 19:34:47 +00:00
typename-specifier.cpp [Lit Test] Updated 26 Lit tests to be C++11 compatible. 2015-11-11 19:34:47 +00:00
typo-dependent-name.cpp
undefined-template.cpp Warn if function or variable cannot be implicitly instantiated 2016-04-19 06:19:52 +00:00
unresolved-construct.cpp
unused-variables.cpp
value-dependent-null-pointer-constant.cpp
virtual-member-functions.cpp Don't let virtual calls and dynamic casts call Sema::MarkVTableUsed(). 2015-01-26 06:23:36 +00:00