1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

fixing bug 62359 [Content Assist] failure on iostream in Linux

- fix problem during errorhandling
- fix operator function names
- fix NPE during template argument deduction
This commit is contained in:
Andrew Niefer 2004-05-25 18:42:30 +00:00
parent 4e4b2fc233
commit c0ba9bebfc
3 changed files with 8 additions and 5 deletions

View file

@ -197,8 +197,8 @@ public abstract class Parser extends ExpressionParser implements IParser
protected void errorHandling() throws EndOfFileException protected void errorHandling() throws EndOfFileException
{ {
failParse(); failParse();
consume(); int depth = ( LT(1) == IToken.tLBRACE ) ? 1 : 0;
int depth = 0; consume();
while (!((LT(1) == IToken.tSEMI && depth == 0) while (!((LT(1) == IToken.tSEMI && depth == 0)
|| (LT(1) == IToken.tRBRACE && depth == 1))) || (LT(1) == IToken.tRBRACE && depth == 1)))
{ {

View file

@ -2056,7 +2056,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
} }
} }
IParameterizedSymbol symbol = pst.newParameterizedSymbol( name.getFirstToken().getImage(), TypeInfo.t_function ); IParameterizedSymbol symbol = pst.newParameterizedSymbol( name.extractNameFromTemplateId(), TypeInfo.t_function );
setFunctionTypeInfoBits(isInline, isFriend, isStatic, symbol); setFunctionTypeInfoBits(isInline, isFriend, isStatic, symbol);
symbol.setHasVariableArgs( hasVariableArguments ); symbol.setHasVariableArgs( hasVariableArguments );

View file

@ -366,8 +366,11 @@ public final class TemplateEngine {
return deferred.getArguments(); return deferred.getArguments();
} }
ISymbol instantiated = symbol.getInstantiatedSymbol(); ISymbol instantiated = symbol.getInstantiatedSymbol();
ITemplateSymbol template = (ITemplateSymbol) instantiated.getContainingSymbol(); if( instantiated != null ){
return template.findArgumentsFor( (IContainerSymbol) symbol ); ITemplateSymbol template = (ITemplateSymbol) instantiated.getContainingSymbol();
return template.findArgumentsFor( (IContainerSymbol) symbol );
}
return null;
} }
/** /**