1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Bug 531475 - Push a lookup point when precomputing variable types and initial values in PDOMWriter.resolveNames()

Change-Id: Ia9d0c51a963f70d9a8b0ffcd3fa6b6c508f1d1dc
This commit is contained in:
Nathan Ridge 2018-02-22 00:10:07 -05:00
parent 3ff810915a
commit af73a4ed1a

View file

@ -428,9 +428,19 @@ public abstract class PDOMWriter implements IPDOMASTProcessor {
// to the index.
for (ICPPInternalDeclaredVariable variable : variables) {
if (isVariableIndexed(variable)) {
// Type and initial value will be cached by the variable.
variable.getType();
variable.getInitialValue();
IASTNode lookupPoint = variable.getDefinition() != null
? variable.getDefinition()
: (variable.getDeclarations() != null && variable.getDeclarations().length > 0)
? variable.getDeclarations()[0]
: data.fAST;
CPPSemantics.pushLookupPoint(lookupPoint);
try {
// Type and initial value will be cached by the variable.
variable.getType();
variable.getInitialValue();
} finally {
CPPSemantics.popLookupPoint();
}
}
}