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:
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();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue