]> granicus.if.org Git - clang/commit
Implement explicit instantiations of member classes of class templates, e.g.,
authorDouglas Gregor <dgregor@apple.com>
Thu, 14 May 2009 00:28:11 +0000 (00:28 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 14 May 2009 00:28:11 +0000 (00:28 +0000)
commit3f5b61c394f4f205bcb4d316eb2a7a0a68b8af86
tree4da57b179612b81db0cd320a032aa390044f29db
parent88f1ba0f0439e31ab57ffc088aa91137cadee585
Implement explicit instantiations of member classes of class templates, e.g.,

  template<typename T>
  struct X {
    struct Inner;
  };

  template struct X<int>::Inner;

This change is larger than it looks because it also fixes some
a problem with nested-name-specifiers and tags. We weren't requiring
the DeclContext associated with the scope specifier of a tag to be
complete. Therefore, when looking for something like "struct
X<int>::Inner", we weren't instantiating X<int>.

This, naturally, uncovered a problem with member pointers, where we
were requiring the left-hand side of a member pointer access
expression (e.g., x->*) to be a complete type. However, this is wrong:
the semantics of this expression does not require a complete type (EDG
agrees).

Stuart vouched for me. Blame him.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71756 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Parse/Action.h
include/clang/Parse/Parser.h
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseExprCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaCXXScopeSpec.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiate.cpp
test/SemaCXX/member-pointer.cpp
test/SemaTemplate/instantiate-complete.cpp
test/SemaTemplate/instantiate-typedef.cpp
test/SemaTemplate/temp_explicit.cpp