mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
small changes to help with template parsing
This commit is contained in:
parent
cd7f23c372
commit
34db07a830
3 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-04-06 Andrew Niefer
|
||||
Small changes to help with template parsing
|
||||
- report line numbers with some problems
|
||||
- don't throw on SEMANTIC_INVALID_TYPE while doing templates
|
||||
- handle some NPEs
|
||||
|
||||
2004-04-06 Andrew Niefer
|
||||
fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=47625
|
||||
|
||||
|
|
|
@ -715,10 +715,10 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
}
|
||||
|
||||
if( classSymbol != null && ! classSymbol.isForwardDeclaration() )
|
||||
handleProblem( IProblem.SEMANTIC_UNIQUE_NAME_PREDEFINED, newSymbolName );
|
||||
handleProblem( IProblem.SEMANTIC_UNIQUE_NAME_PREDEFINED, newSymbolName, nameOffset, nameEndOffset, nameLine );
|
||||
|
||||
if( classSymbol != null && classSymbol.getType() != pstType )
|
||||
handleProblem( IProblem.SEMANTIC_INVALID_OVERLOAD, newSymbolName );
|
||||
handleProblem( IProblem.SEMANTIC_INVALID_OVERLOAD, newSymbolName, nameOffset, nameEndOffset, nameLine );
|
||||
}
|
||||
|
||||
IDerivableContainerSymbol newSymbol = pst.newDerivableContainerSymbol( newSymbolName, pstType );
|
||||
|
@ -803,7 +803,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
if( scope != null ){
|
||||
IContainerSymbol symbol = scopeToSymbol( scope );
|
||||
if( symbol.isTemplateMember() ){
|
||||
if( id == IProblem.SEMANTIC_INVALID_CONVERSION_TYPE )
|
||||
if( id == IProblem.SEMANTIC_INVALID_CONVERSION_TYPE ||
|
||||
id == IProblem.SEMANTIC_INVALID_TYPE )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -2237,6 +2238,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
Iterator p = parameters.iterator();
|
||||
while (p.hasNext()){
|
||||
ASTParameterDeclaration param = (ASTParameterDeclaration)p.next();
|
||||
if( param.getSymbol() == null )
|
||||
handleProblem( IProblem.SEMANTICS_RELATED, param.getName(), param.getNameOffset(), param.getEndingOffset(), param.getNameLineNumber() );
|
||||
functionParameters.add(param.getSymbol().getTypeInfo());
|
||||
}
|
||||
|
||||
|
|
|
@ -638,6 +638,8 @@ public class ParserSymbolTable {
|
|||
{
|
||||
wrapper = (IDerivableContainerSymbol.IParentSymbol) iterator.next();
|
||||
ISymbol parent = wrapper.getParent();
|
||||
if( parent == null )
|
||||
continue;
|
||||
|
||||
if( !wrapper.isVirtual() || !data.visited.contains( parent ) ){
|
||||
if( wrapper.isVirtual() ){
|
||||
|
@ -947,7 +949,7 @@ public class ParserSymbolTable {
|
|||
if( resolvedSymbol != null && resolvedSymbol.getTypeInfo().checkBit( TypeInfo.isTypedef ) ){
|
||||
ISymbol symbol = resolvedSymbol.getTypeSymbol();
|
||||
if( symbol == null )
|
||||
throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo );
|
||||
return resolvedSymbol;
|
||||
|
||||
TypeInfo info = ParserSymbolTable.getFlatTypeInfo( symbol.getTypeInfo() );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue