diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-25 21:45:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-25 21:45:23 +0000 |
commit | db422dffb720ff41d0b60e228f45c685600ffa9e (patch) | |
tree | 347abefb53d70d332ac3bdf0fe1097a4c69137a0 /lib/Parse/ParseDecl.cpp | |
parent | 699a07d8a0b1579c5178b3baf4bcf9edb6b38108 (diff) |
Declarators can now properly represent template-ids, e.g., for
template void f<int>(int);
~~~~~~
Previously, we silently dropped the template arguments. With this
change, we now use the template arguments (when available) as the
explicitly-specified template arguments used to aid template argument
deduction for explicit template instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 9525eb364c..2dac473cc6 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2210,12 +2210,12 @@ void Parser::ParseDeclaratorInternal(Declarator &D, /// /// id-expression: [C++ 5.1] /// unqualified-id -/// qualified-id [TODO] +/// qualified-id /// /// unqualified-id: [C++ 5.1] /// identifier /// operator-function-id -/// conversion-function-id [TODO] +/// conversion-function-id /// '~' class-name /// template-id /// @@ -2254,15 +2254,7 @@ void Parser::ParseDirectDeclarator(Declarator &D) { TemplateIdAnnotation *TemplateId = static_cast<TemplateIdAnnotation *>(Tok.getAnnotationValue()); - // FIXME: Could this template-id name a constructor? - - // FIXME: This is an egregious hack, where we silently ignore - // the specialization (which should be a function template - // specialization name) and use the name instead. This hack - // will go away when we have support for function - // specializations. - D.SetIdentifier(TemplateId->Name, Tok.getLocation()); - TemplateId->Destroy(); + D.setTemplateId(TemplateId); ConsumeToken(); goto PastIdentifier; } else if (Tok.is(tok::kw_operator)) { |