Commit Graph

3 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis c0dc36b213 Change warning about incomplete parsing of C++ default arg to error and provide a test case; thanks Doug!
llvm-svn: 110603
2010-08-09 21:08:13 +00:00
Argyrios Kyrtzidis 249179cd73 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
2010-08-06 09:47:24 +00:00
Argyrios Kyrtzidis 998d51b98f When "delayed parsing" C++ default arguments, if there is an error, there may be tokens left in the token stream
that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because
the CachedTokens that holds them will be deleted while the lexer is still using them.

Make sure that the tokens of default args are removed from the token stream.
Fixes PR6647.

llvm-svn: 99939
2010-03-30 22:14:32 +00:00