diff options
author | John McCall <rjmccall@apple.com> | 2010-10-19 18:40:57 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-19 18:40:57 +0000 |
commit | a25c4080a490ea2bab6f54094dd75b19eae83770 (patch) | |
tree | 8c0df9f3be3ef5384ec05e78842a9667fd81fa41 /lib/Parse/ParseDeclCXX.cpp | |
parent | af8fa25c0d4e0540952a50bbd06dc1558954ccd9 (diff) |
Tag references shouldn't ever get template parameter lists.
Fixes rdar://problem/8568507
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index ce227c6ff2..083d6ab798 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -964,13 +964,18 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, bool IsDependent = false; + // Don't pass down template parameter lists if this is just a tag + // reference. For example, we don't need the template parameters here: + // template <class T> class A *makeA(T t); + MultiTemplateParamsArg TParams; + if (TUK != Sema::TUK_Reference && TemplateParams) + TParams = + MultiTemplateParamsArg(&(*TemplateParams)[0], TemplateParams->size()); + // Declaration or definition of a class type TagOrTempResult = Actions.ActOnTag(getCurScope(), TagType, TUK, StartLoc, SS, Name, NameLoc, AttrList, AS, - MultiTemplateParamsArg(Actions, - TemplateParams? &(*TemplateParams)[0] : 0, - TemplateParams? TemplateParams->size() : 0), - Owned, IsDependent, false, + TParams, Owned, IsDependent, false, clang::TypeResult()); // If ActOnTag said the type was dependent, try again with the |