if (FormatTok.Tok.is(tok::l_paren)) {
parseParens();
}
- if (FormatTok.Tok.is(tok::identifier))
+ // The actual identifier can be a nested name specifier.
+ while (FormatTok.Tok.is(tok::identifier) ||
+ FormatTok.Tok.is(tok::coloncolon))
nextToken();
if (FormatTok.Tok.is(tok::colon)) {
// Actual definitions...
verifyFormat("struct {} n;");
- verifyFormat("template <template <class T, class Y>, class Z > class X {} n;");
+ verifyFormat(
+ "template <template <class T, class Y>, class Z > class X {} n;");
verifyFormat("union Z {\n int n;\n} x;");
verifyFormat("class MACRO Z {} n;");
verifyFormat("class MACRO(X) Z {} n;");
verifyFormat("class __attribute__(X) Z {} n;");
verifyFormat("class __declspec(X) Z {} n;");
+ // Redefinition from nested context:
+ verifyFormat("class A::B::C {} n;");
+
// Elaborate types where incorrectly parsing the structural element would
// break the indent.
verifyFormat("if (true)\n"