mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Example 6.8-2 from c++-specification, bug 90622.
This commit is contained in:
parent
0424024136
commit
8758582793
3 changed files with 19 additions and 20 deletions
|
@ -48,23 +48,6 @@ public class AST2CPPSpecFailingTest extends AST2SpecBaseTest {
|
||||||
parse(getAboveComment(), ParserLanguage.CPP, true, 2);
|
parse(getAboveComment(), ParserLanguage.CPP, true, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class T {
|
|
||||||
// // ...
|
|
||||||
// public:
|
|
||||||
// T();
|
|
||||||
// T(int);
|
|
||||||
// T(int, int);
|
|
||||||
// };
|
|
||||||
// T(a); //declaration
|
|
||||||
// T(*b)(); //declaration
|
|
||||||
// T(c)=7; //declaration
|
|
||||||
// T(d),e,f=3; //declaration
|
|
||||||
// extern int h;
|
|
||||||
// T(g)(h,2); //declaration
|
|
||||||
public void _test6_8s2() throws Exception { // TODO raised bug 90622
|
|
||||||
parse(getAboveComment(), ParserLanguage.CPP, true, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// struct B {
|
// struct B {
|
||||||
// virtual void f(int);
|
// virtual void f(int);
|
||||||
// virtual void f(char);
|
// virtual void f(char);
|
||||||
|
|
|
@ -995,6 +995,23 @@ public class AST2CPPSpecTest extends AST2SpecBaseTest {
|
||||||
parse(getAboveComment(), ParserLanguage.CPP, false, 0);
|
parse(getAboveComment(), ParserLanguage.CPP, false, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// class T {
|
||||||
|
// // ...
|
||||||
|
// public:
|
||||||
|
// T();
|
||||||
|
// T(int);
|
||||||
|
// T(int, int);
|
||||||
|
// };
|
||||||
|
// T(a); //declaration
|
||||||
|
// T(*b)(); //declaration
|
||||||
|
// T(c)=7; //declaration
|
||||||
|
// T(d),e,f=3; //declaration
|
||||||
|
// extern int h;
|
||||||
|
// T(g)(h,2); //declaration
|
||||||
|
public void test6_8s2() throws Exception { // TODO raised bug 90622
|
||||||
|
parse(getAboveComment(), ParserLanguage.CPP, true, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// struct T1 {
|
// struct T1 {
|
||||||
// T1 operator()(int x) { return T1(x); }
|
// T1 operator()(int x) { return T1(x); }
|
||||||
// int operator=(int x) { return x; }
|
// int operator=(int x) { return x; }
|
||||||
|
|
|
@ -3237,7 +3237,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
*/
|
*/
|
||||||
protected IASTDeclarator initDeclarator(DtorStrategy strategy, DeclarationOptions option)
|
protected IASTDeclarator initDeclarator(DtorStrategy strategy, DeclarationOptions option)
|
||||||
throws EndOfFileException, BacktrackException {
|
throws EndOfFileException, BacktrackException {
|
||||||
|
|
||||||
final IASTDeclarator dtor= declarator(strategy, option);
|
final IASTDeclarator dtor= declarator(strategy, option);
|
||||||
if (option.fAllowInitializer) {
|
if (option.fAllowInitializer) {
|
||||||
IASTInitializer initializer= optionalCPPInitializer(dtor);
|
IASTInitializer initializer= optionalCPPInitializer(dtor);
|
||||||
|
@ -3420,9 +3419,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
if (LT(1) == IToken.tRPAREN)
|
if (LT(1) == IToken.tRPAREN)
|
||||||
throwBacktrack(LA(1));
|
throwBacktrack(LA(1));
|
||||||
|
|
||||||
final IASTDeclarator nested= declarator(strategy, option);
|
final IASTDeclarator nested= declarator(DtorStrategy.PREFER_FUNCTION, option);
|
||||||
endOffset= consume(IToken.tRPAREN).getEndOffset();
|
endOffset= consume(IToken.tRPAREN).getEndOffset();
|
||||||
final IASTDeclarator cand2= declarator(pointerOps, null, nested, startingOffset, endOffset, DtorStrategy.PREFER_FUNCTION, option);
|
final IASTDeclarator cand2= declarator(pointerOps, null, nested, startingOffset, endOffset, strategy, option);
|
||||||
if (cand1 == null || cand1End == null)
|
if (cand1 == null || cand1End == null)
|
||||||
return cand2;
|
return cand2;
|
||||||
final IToken cand2End= LA(1);
|
final IToken cand2End= LA(1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue