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

Bug 398696. Failing test case.

This commit is contained in:
Sergey Prigogin 2013-01-21 21:42:01 -08:00
parent 2d3cc44232
commit f94c6909ac

View file

@ -44,6 +44,7 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.IBasicType; import org.eclipse.cdt.core.dom.ast.IBasicType;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IFunction; import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.dom.ast.IFunctionType; import org.eclipse.cdt.core.dom.ast.IFunctionType;
@ -55,6 +56,7 @@ import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.ISemanticProblem; import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IValue;
import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExplicitTemplateInstantiation; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExplicitTemplateInstantiation;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier;
@ -7005,13 +7007,6 @@ public class AST2TemplateTests extends AST2BaseTest {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template<typename T, unsigned n> struct A {};
//
// template<typename T>
// struct A<T, 0> {
// static void m();
// };
//
// template <typename T> // template <typename T>
// struct B { // struct B {
// enum { value = 1 }; // enum { value = 1 };
@ -7022,15 +7017,16 @@ public class AST2TemplateTests extends AST2BaseTest {
// enum { id = B<T>::value ? 0 : -1 }; // enum { id = B<T>::value ? 0 : -1 };
// }; // };
// //
// template<typename T>
// struct D {
// typedef A<T, C<T>::id> E;
// };
//
// void test() { // void test() {
// D<bool>::E::m(); // int x = C<bool>::id;
// } // }
public void testDependentEnum_398696() throws Exception { public void _testDependentEnum_398696() throws Exception {
parseAndCheckBindings(); BindingAssertionHelper ah = getAssertionHelper();
IEnumerator binding = ah.assertNonProblem("C<bool>::id", "id");
IBinding owner = binding.getOwner();
IValue value = binding.getValue();
Long num = value.numericalValue();
assertNotNull(num);
assertEquals(0, num.longValue());
} }
} }