Introduce a new token kind 'cxx_defaultarg_end' to mark the end of C++ default arguments that were part of
lexed method declarations.
This avoid interference with tokens coming after the point where the default arg tokens were 'injected', e.g. for
typedef struct Inst {
void m(int x=0);
} *InstPtr;
when parsing '0' the next token would be '*' and things would be messed up.
llvm-svn: 110436
diff --git a/clang/test/Parser/cxx-default-args.cpp b/clang/test/Parser/cxx-default-args.cpp
index a084fb0..a7bb5ee 100644
--- a/clang/test/Parser/cxx-default-args.cpp
+++ b/clang/test/Parser/cxx-default-args.cpp
@@ -7,3 +7,6 @@
void m(int x = undecl + 0); // expected-error {{use of undeclared identifier 'undecl'}}
};
+typedef struct Inst {
+ void m(int x=0);
+} *InstPtr;