diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-06-16 22:31:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-06-16 22:31:08 +0000 |
commit | f7d77718123f89862cd761cf3bac4d5e80808e40 (patch) | |
tree | 1b58c3848efa8058bcbcdea774678aa475886535 /clang/lib/Parse/Parser.cpp | |
parent | d50c96a002f39ec9dba678acb391f7658201fd4c (diff) | |
download | bcm5719-llvm-f7d77718123f89862cd761cf3bac4d5e80808e40.tar.gz bcm5719-llvm-f7d77718123f89862cd761cf3bac4d5e80808e40.zip |
Fix the recently-added warning about 'typename' and 'template'
disambiguation keywords outside of templates in C++98/03. Previously,
the warning would fire when the associated nested-name-specifier was
not dependent, but that was a misreading of the C++98/03 standard:
now, we complain only when we're outside of any template.
llvm-svn: 106161
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 296897080d0..225a793af53 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -919,7 +919,8 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext) { TypeResult Ty; if (Tok.is(tok::identifier)) { // FIXME: check whether the next token is '<', first! - Ty = Actions.ActOnTypenameType(TypenameLoc, SS, *Tok.getIdentifierInfo(), + Ty = Actions.ActOnTypenameType(CurScope, TypenameLoc, SS, + *Tok.getIdentifierInfo(), Tok.getLocation()); } else if (Tok.is(tok::annot_template_id)) { TemplateIdAnnotation *TemplateId @@ -934,7 +935,8 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext) { assert(Tok.is(tok::annot_typename) && "AnnotateTemplateIdTokenAsType isn't working properly"); if (Tok.getAnnotationValue()) - Ty = Actions.ActOnTypenameType(TypenameLoc, SS, SourceLocation(), + Ty = Actions.ActOnTypenameType(CurScope, TypenameLoc, SS, + SourceLocation(), Tok.getAnnotationValue()); else Ty = true; |