hanchenye-llvm-project/clang/test/SemaTemplate
Douglas Gregor 4109afa1f1 Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case). 

Fixes <rdar://problem/9676205>.

Reinstated, now that we have the fix in r143967.

llvm-svn: 143968
2011-11-07 17:43:18 +00:00
..
ackermann.cpp
address-spaces.cpp When comparing parameters of reference-to-qualified type during 2011-04-30 17:07:52 +00:00
alias-church-numerals.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
alias-nested-nontag.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
alias-template-template-param.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
alias-templates.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
ambiguous-ovl-print.cpp
anonymous-union.cpp
array-to-pointer-decay.cpp
atomics.cpp When type-checking a call to an overloaded, builtin atomic operation, 2011-09-09 16:51:10 +00:00
attributes.cpp For the various CF and NS attributes, don't complain if the parameter 2011-10-09 22:26:49 +00:00
canonical-expr-type-0x.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
canonical-expr-type.cpp
class-template-ctor-initializer.cpp
class-template-decl.cpp Drastically simplify the mapping from the declaration corresponding to 2011-11-07 17:43:18 +00:00
class-template-id-2.cpp
class-template-id.cpp
class-template-spec.cpp Diagnose class template (partial) specializations that occur in the 2011-10-20 16:41:18 +00:00
constructor-template.cpp
copy-ctor-assign.cpp
crash-8204126.cpp
current-instantiation.cpp When declaring an out-of-line template, attempt to rebuild any types 2011-10-14 15:31:12 +00:00
deduction-crash.cpp It's considered poor form to create references to the overloaded 2011-05-21 22:16:50 +00:00
deduction.cpp Restore the C-style cast hack for enum template arguments, 2011-07-15 07:47:58 +00:00
default-arguments-cxx0x.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
default-arguments.cpp When performing substitution of default template template parameters 2011-06-15 14:20:42 +00:00
default-expr-arguments-2.cpp
default-expr-arguments.cpp Enhance the diagnostic for negative array sizes to include the 2011-01-04 04:44:35 +00:00
delegating-constructors.cpp Rework the AST for the initializer of a delegating constructor, so 2011-11-01 01:16:03 +00:00
dependent-base-classes.cpp
dependent-base-member-init.cpp
dependent-class-member-operator.cpp
dependent-expr.cpp
dependent-names-no-std.cpp Hyphenate "argument-dependent". 2011-06-14 12:59:25 +00:00
dependent-names.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
dependent-sized_array.cpp
dependent-template-recover.cpp When constructing source-location information for a 2011-03-04 18:53:13 +00:00
dependent-type-identity.cpp
destructor-template.cpp Diagnose destructor templates. Fixes PR7904. 2011-03-04 22:45:55 +00:00
elaborated-type-specifier.cpp
enum-argument.cpp
enum-forward.cpp
example-dynarray.cpp
example-typelist.cpp
explicit-instantiation.cpp Make the invalid declarator recovery when parsing members work the same as when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case. 2011-04-24 16:27:48 +00:00
explicit-specialization-member.cpp
ext-vector-type.cpp Eliminate a 'default' case in template argument deduction, where we 2011-06-15 16:02:29 +00:00
extern-templates.cpp
fibonacci.cpp
friend-template.cpp When we parse something that looks like a templated friend tag but 2011-10-20 15:58:54 +00:00
friend.cpp
fun-template-def.cpp
function-template-specialization.cpp Disallow function template partial specializations, from Hans 2011-01-24 18:54:39 +00:00
implicit-instantiation-1.cpp
inject-templated-friend-post.cpp
inject-templated-friend.cpp
injected-class-name.cpp
instantiate-anonymous-union.cpp When building a qualified reference to a member of an anonymous struct 2011-02-18 02:44:58 +00:00
instantiate-array.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
instantiate-attr.cpp
instantiate-c99.cpp
instantiate-call.cpp Hyphenate "argument-dependent". 2011-06-14 12:59:25 +00:00
instantiate-case.cpp
instantiate-cast.cpp Implement appropriate semantics for C++ casting and conversion when 2011-04-15 17:59:54 +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 Enhance the diagnostic for negative array sizes to include the 2011-01-04 04:44:35 +00:00
instantiate-dependent-nested-name.cpp
instantiate-elab-type-specifier.cpp
instantiate-enum-2.cpp
instantiate-enum.cpp
instantiate-exception-spec.cpp
instantiate-expr-1.cpp When transforming the arguments for a C++ "new" expression, make sure 2011-10-18 02:43:19 +00:00
instantiate-expr-2.cpp
instantiate-expr-3.cpp Properly diagnose using abstract and incomplete types in va_arg 2011-06-14 05:17:32 +00:00
instantiate-expr-4.cpp Fix crash due to missing array-to-pointer decay when instantiating an unresolved 2011-10-26 06:49:26 +00:00
instantiate-expr-5.cpp
instantiate-expr-basic.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
instantiate-field.cpp Before checking bitfield initialization, make sure that neither the 2011-02-04 13:09:01 +00:00
instantiate-friend-class.cpp
instantiate-function-1.cpp When determining whether we need to instantiate a function type, 2011-05-09 20:45:16 +00:00
instantiate-function-1.mm
instantiate-function-2.cpp Switch diagnostic text from "C++0x" over to "C++11". 2011-10-12 19:26:40 +00:00
instantiate-function-params.cpp
instantiate-init.cpp Improve the instantiation of static data members in 2011-06-03 14:28:43 +00:00
instantiate-invalid.cpp
instantiate-local-class.cpp For member pointer conversions potentially involving derived-to-base 2010-12-21 21:40:41 +00:00
instantiate-member-class.cpp Tighten up the conditions under which we consider ourselves to be 2011-11-07 17:33:42 +00:00
instantiate-member-expr.cpp Enhance the diagnostic for negative array sizes to include the 2011-01-04 04:44:35 +00:00
instantiate-member-initializers.cpp
instantiate-member-pointers.cpp Enhance the diagnostic for negative array sizes to include the 2011-01-04 04:44:35 +00:00
instantiate-member-template.cpp When transforming a dependent template specialization type, make sure 2011-03-07 02:33:33 +00:00
instantiate-method.cpp
instantiate-non-dependent-types.cpp
instantiate-non-type-template-parameter.cpp When we're creating an expression for an integral template argument of 2011-02-18 02:12:44 +00:00
instantiate-objc-1.mm
instantiate-overload-candidates.cpp
instantiate-overloaded-arrow.cpp
instantiate-static-var.cpp Mark the ExtWarn for in-class initialization of static const float members as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode. 2011-09-29 23:18:34 +00:00
instantiate-subscript.cpp
instantiate-template-template-parm.cpp Add test for PR8629 2011-01-25 18:11:52 +00:00
instantiate-try-catch.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
instantiate-type.cpp
instantiate-typedef.cpp
instantiate-using-decl.cpp
instantiation-backtrace.cpp
instantiation-default-1.cpp
instantiation-default-2.cpp
instantiation-default-3.cpp
instantiation-depth.cpp
issue150.cpp When substituting in for a template name, do not produce a qualified 2011-03-05 20:06:51 +00:00
lookup-dependent-bases.cpp In Microsoft mode, if we are within a templated function and we can't resolve Identifier during BuildCXXNestedNameSpecifier, then extend the SS with Identifier. This will have the effect of resolving Identifier during template instantiation. The goal is to be able to resolve a function call whose nested-name-specifier is located inside a dependent base class. 2011-07-27 01:05:24 +00:00
member-access-ambig.cpp When performing name lookup for the previous declaration of a field, 2011-10-21 15:47:52 +00:00
member-access-expr.cpp
member-function-template.cpp
member-inclass-init-value-dependent.cpp Replace r134583's fix for PR10290 with one which also works for non-value-dependent cases. 2011-07-20 00:12:52 +00:00
member-initializers.cpp
member-template-access-expr.cpp
metafun-apply.cpp
missing-class-keyword-crash.cpp Fix a crash-on-invalid. 2011-08-25 23:22:24 +00:00
ms-function-specialization-class-scope.cpp fix typo in test. 2011-08-14 22:30:29 +00:00
ms-if-exists.cpp Check for unexpanded parameter packs in the name that guards a 2011-10-25 03:44:56 +00:00
ms-lookup-template-base-classes.cpp In Microsoft mode, if we are inside a template class member function and we can't resolve a function call then create a type-dependent CallExpr even if the function has no type dependent arguments. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes. 2011-09-07 00:14:57 +00:00
nested-linkage.cpp
nested-name-spec-template.cpp Don't ask if a depenendent CXXRecordDecl has any dependent bases 2011-03-11 23:27:41 +00:00
nested-template.cpp When we see an out-of-line definition of a member class template that 2011-11-01 21:35:16 +00:00
operator-function-id-template.cpp
operator-template.cpp When we determine that a function template specialization produced as 2011-10-12 20:35:48 +00:00
overload-candidates.cpp
overload-uneval.cpp Whitelist operator== and operator!= as valid for unused value warnings, 2011-08-17 09:49:44 +00:00
partial-spec-instantiate.cpp When converting an integral template argument value to a non-type 2011-05-04 21:55:00 +00:00
qualified-id.cpp
qualified-names-diag.cpp
rdar9173693.cpp Fix a double free when parsing malformed code. Fixes rdar://9173693. 2011-05-03 18:45:38 +00:00
recovery-crash.cpp
recursive-template-instantiation.cpp
resolve-single-template-id.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
self-comparison.cpp
temp.cpp
temp_arg.cpp
temp_arg_nontype.cpp When we determine that a function template specialization produced as 2011-10-12 20:35:48 +00:00
temp_arg_template.cpp Detect when the string "<::" is found in code after a cast or template name and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::". 2011-04-14 21:45:45 +00:00
temp_arg_type.cpp
temp_class_order.cpp
temp_class_spec.cpp
temp_class_spec_blocks.cpp
temp_class_spec_neg.cpp
temp_explicit.cpp Switch to the C++11 warning flags in tests. 2011-10-18 05:54:07 +00:00
temp_explicit_cxx0x.cpp Refactor the checking for explicit template instantiations being performed in 2011-10-18 02:28:33 +00:00
temp_func_order.cpp
template-class-traits.cpp
template-decl-fail.cpp
template-id-expr.cpp
template-id-printing.cpp
typename-specifier-2.cpp
typename-specifier-3.cpp
typename-specifier-4.cpp When building a type for a typename specifier, check specifically for 2011-03-01 16:44:30 +00:00
typename-specifier.cpp Diagnose attempts to use 'using typename' with a non-identifier name, 2011-09-26 14:30:28 +00:00
typo-dependent-name.cpp
unresolved-construct.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
unused-variables.cpp
value-dependent-null-pointer-constant.cpp
virtual-member-functions.cpp