mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 01:06:01 +02:00
[99426] Fixed completion of declSpecs in function parameters.
This commit is contained in:
parent
e1abf3b487
commit
58615beb77
3 changed files with 16 additions and 8 deletions
|
@ -1946,6 +1946,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
|||
parameterDeclarationLoop: for (;;) {
|
||||
switch (LT(1)) {
|
||||
case IToken.tRPAREN:
|
||||
case IToken.tEOC:
|
||||
last = consume();
|
||||
finalOffset = last.getEndOffset();
|
||||
break parameterDeclarationLoop;
|
||||
|
|
|
@ -1425,13 +1425,15 @@ public class CPPSemantics {
|
|||
else if( node instanceof IASTParameterDeclaration ){
|
||||
IASTParameterDeclaration parameterDeclaration = (IASTParameterDeclaration) node;
|
||||
IASTDeclarator dtor = parameterDeclaration.getDeclarator();
|
||||
while( dtor.getNestedDeclarator() != null )
|
||||
dtor = dtor.getNestedDeclarator();
|
||||
IASTName declName = dtor.getName();
|
||||
scope.addName( declName );
|
||||
if( !data.typesOnly && nameMatches( data, declName ) ) {
|
||||
return declName;
|
||||
}
|
||||
if (dtor != null) { // could be null when content assist in the declSpec
|
||||
while( dtor.getNestedDeclarator() != null )
|
||||
dtor = dtor.getNestedDeclarator();
|
||||
IASTName declName = dtor.getName();
|
||||
scope.addName( declName );
|
||||
if( !data.typesOnly && nameMatches( data, declName ) ) {
|
||||
return declName;
|
||||
}
|
||||
}
|
||||
} else if( node instanceof ICPPASTTemplateParameter ){
|
||||
IASTName name = CPPTemplates.getTemplateParameterName( (ICPPASTTemplateParameter) node );
|
||||
scope.addName( name );
|
||||
|
|
|
@ -3114,8 +3114,13 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
throwBacktrack( e.currToken );
|
||||
}
|
||||
IASTDeclarator declarator = null;
|
||||
if (LT(1) != IToken.tSEMI)
|
||||
switch (LT(1)) {
|
||||
case IToken.tSEMI:
|
||||
case IToken.tEOC:
|
||||
break;
|
||||
default:
|
||||
declarator = initDeclarator(SimpleDeclarationStrategy.TRY_FUNCTION);
|
||||
}
|
||||
|
||||
if (current == LA(1)) {
|
||||
throwBacktrack(current.getOffset(), figureEndOffset(declSpec,
|
||||
|
|
Loading…
Add table
Reference in a new issue