1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Scope for deferred instances, bug 289132.

This commit is contained in:
Markus Schorn 2009-09-30 10:30:37 +00:00
parent bf4a4149cf
commit 1754ae59b2
2 changed files with 24 additions and 5 deletions

View file

@ -4149,4 +4149,22 @@ public class AST2TemplateTests extends AST2BaseTest {
ICPPFunction func= bh.assertNonProblem("f(x)", 1, ICPPFunction.class);
assertFalse(func instanceof ICPPUnknownBinding);
}
// class NullType {};
// template <typename T, typename U> struct TypeList {
// typedef T Head;
// typedef U Tail;
// };
//
// template <typename T1 = NullType, typename T2 = NullType> struct CreateTL {
// typedef TypeList<T1, typename CreateTL<T2>::Type> Type;
// };
//
// template<> struct CreateTL<NullType, NullType> {
// typedef NullType Type;
// };
public void testDefaultArgument_289132() throws Exception {
final String code= getAboveComment();
parseAndCheckBindings(code, ParserLanguage.CPP);
}
}

View file

@ -1311,11 +1311,12 @@ public class CPPTemplates {
}
public static boolean areSameArguments(ICPPTemplateArgument[] args, ICPPTemplateArgument[] specArgs) {
if (args.length == specArgs.length) {
for (int i=0; i < args.length; i++) {
if (!specArgs[i].isSameValue(args[i]))
return false;
}
if (args.length != specArgs.length) {
return false;
}
for (int i=0; i < args.length; i++) {
if (!specArgs[i].isSameValue(args[i]))
return false;
}
return true;
}