Граф коммитов

3 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis 219cffcad3 Change warning about incomplete parsing of C++ default arg to error and provide a test case; thanks Doug!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:08:13 +00:00
Argyrios Kyrtzidis 2b602adf97 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 09:47:24 +00:00
Argyrios Kyrtzidis 7fd3a6456a 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:14:32 +00:00