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

Bug 395074 - NPE in EvalFixed.<init>

Change-Id: I2457557add26e0121bd974fcc954ed879a8e8cf4
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Reviewed-on: https://git.eclipse.org/r/19932
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2013-12-17 22:06:12 -05:00 committed by Sergey Prigogin
parent bb6d85dbd0
commit d9c4584257
2 changed files with 20 additions and 1 deletions

View file

@ -7741,6 +7741,24 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
helper.assertProblem("bind(s, 0, foo)", "bind");
}
// struct a3 {
// int xxx;
// };
//
// template <template <typename> class V>
// struct S {};
//
// template <typename V>
// int foo(...);
//
// template <typename V>
// int foo(void*, S<V::template xxx>* = 0);
//
// int value = sizeof(foo<a3>(0));
public void testNPE_395074() throws Exception {
parseAndCheckBindings();
}
// template<typename T>
// T forward(T);

View file

@ -264,7 +264,8 @@ public class EvalMemberAccess extends CPPDependentEvaluation {
return ((IEnumerator) fMember).getValue();
}
if (fMember instanceof IVariable) {
return ((IVariable) fMember).getInitialValue();
IValue initialValue = ((IVariable) fMember).getInitialValue();
return initialValue == null ? Value.UNKNOWN : initialValue;
}
if (fMember instanceof IFunction) {
return Value.UNKNOWN;