forked from OSchip/llvm-project
Parse a C++ scope specifier followed by a "typename" annotation token as a type name within the declaration specifiers. Fixes PR5061.
llvm-svn: 82974
This commit is contained in:
parent
0261b5d2d2
commit
c5790dfeb4
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) { }
|
||||
}
|
Loading…
Reference in New Issue