1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

fix for bug 92793 for LR parser, qualified IDs as members should be parsed as using declarations

This commit is contained in:
Mike Kucera 2009-01-07 16:36:21 +00:00
parent dd2b180f1e
commit 81bb910442

View file

@ -1880,16 +1880,24 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
IASTName qualifiedId = subRuleQualifiedName(true);
IASTDeclarator declarator = nodeFactory.newDeclarator(qualifiedId);
setOffsetAndLength(declarator);
// there has to be an empty specifier or... kaboom!
IASTDeclSpecifier emptySpecifier = nodeFactory.newSimpleDeclSpecifier();
setOffsetAndLength(emptySpecifier, parser.getLeftIToken().getStartOffset(), 0);
IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(emptySpecifier);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92793
ICPPASTUsingDeclaration declaration = nodeFactory.newUsingDeclaration(qualifiedId);
setOffsetAndLength(declaration);
declaration.addDeclarator(declarator);
astStack.push(declaration);
// IASTDeclarator declarator = nodeFactory.newDeclarator(qualifiedId);
// setOffsetAndLength(declarator);
// IASTDeclSpecifier emptySpecifier = nodeFactory.newSimpleDeclSpecifier();
// setOffsetAndLength(emptySpecifier, parser.getLeftIToken().getStartOffset(), 0);
// IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(emptySpecifier);
// setOffsetAndLength(declaration);
// declaration.addDeclarator(declarator);
//
// astStack.push(declaration);
if(TRACE_AST_STACK) System.out.println(astStack);
}