mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15: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:
parent
dd2b180f1e
commit
81bb910442
1 changed files with 15 additions and 7 deletions
|
@ -1880,16 +1880,24 @@ public class CPPBuildASTParserAction extends BuildASTParserAction {
|
||||||
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
if(TRACE_ACTIONS) DebugUtil.printMethodTrace();
|
||||||
|
|
||||||
IASTName qualifiedId = subRuleQualifiedName(true);
|
IASTName qualifiedId = subRuleQualifiedName(true);
|
||||||
IASTDeclarator declarator = nodeFactory.newDeclarator(qualifiedId);
|
|
||||||
setOffsetAndLength(declarator);
|
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92793
|
||||||
// there has to be an empty specifier or... kaboom!
|
ICPPASTUsingDeclaration declaration = nodeFactory.newUsingDeclaration(qualifiedId);
|
||||||
IASTDeclSpecifier emptySpecifier = nodeFactory.newSimpleDeclSpecifier();
|
|
||||||
setOffsetAndLength(emptySpecifier, parser.getLeftIToken().getStartOffset(), 0);
|
|
||||||
IASTSimpleDeclaration declaration = nodeFactory.newSimpleDeclaration(emptySpecifier);
|
|
||||||
setOffsetAndLength(declaration);
|
setOffsetAndLength(declaration);
|
||||||
declaration.addDeclarator(declarator);
|
|
||||||
astStack.push(declaration);
|
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);
|
if(TRACE_AST_STACK) System.out.println(astStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue