diff options
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 13 | ||||
-rw-r--r-- | test/SemaTemplate/qualified-id.cpp | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 2dac473cc6..d885558e1f 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -778,6 +778,19 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, continue; } + if (Next.is(tok::annot_typename)) { + // FIXME: is this scope-specifier getting dropped? + ConsumeToken(); // the scope-specifier + if (Tok.getAnnotationValue()) + isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, + PrevSpec, DiagID, + Tok.getAnnotationValue()); + else + DS.SetTypeSpecError(); + DS.SetRangeEnd(Tok.getAnnotationEndLoc()); + ConsumeToken(); // The typename + } + if (Next.isNot(tok::identifier)) goto DoneWithDeclSpec; diff --git a/test/SemaTemplate/qualified-id.cpp b/test/SemaTemplate/qualified-id.cpp new file mode 100644 index 0000000000..85efab2b5c --- /dev/null +++ b/test/SemaTemplate/qualified-id.cpp @@ -0,0 +1,9 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +// PR5061 +namespace a { + template <typename T> class C {}; +} +namespace b { + template<typename T> void f0(a::C<T> &a0) { } +} |