diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-10 00:53:15 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-10 00:53:15 +0000 |
commit | 97f34576d4a50a24f4154b85bcff9e29b240e8ac (patch) | |
tree | c507dc5a4c8cc7807d7a3d59474cb18a46c68365 /clang/lib/Parse/ParseTemplate.cpp | |
parent | 85e0f66250637165a815ef78ab4b3fe102d75c8b (diff) | |
download | bcm5719-llvm-97f34576d4a50a24f4154b85bcff9e29b240e8ac.tar.gz bcm5719-llvm-97f34576d4a50a24f4154b85bcff9e29b240e8ac.zip |
Teach the type-id/expression disambiguator about different
disambiguation contexts, so that we properly parse template arguments
such as
A<int()>
as type-ids rather than as expressions. Since this can be confusing
(especially when the template parameter is a non-type template
parameter), we try to give a friendly error message.
Almost, eliminate a redundant error message (that should have been a
note) and add some ultra-basic checks for non-type template
arguments.
llvm-svn: 64189
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index f860058117b..25aea352242 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -456,7 +456,7 @@ void *Parser::ParseTemplateArgument(bool &ArgIsType) { // the corresponding template-parameter. // // Therefore, we initially try to parse a type-id. - if (isTypeIdInParens()) { + if (isCXXTypeId(TypeIdAsTemplateArgument)) { ArgIsType = true; return ParseTypeName(); } |