1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 01:45:33 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2015-05-04 18:29:47 -07:00
parent 956ae66e83
commit 7bc5a81935
2 changed files with 51 additions and 52 deletions

View file

@ -26,8 +26,6 @@ import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUti
import java.io.IOException;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
@ -107,6 +105,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownBinding;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
import org.eclipse.cdt.internal.core.parser.ParserException;
import junit.framework.TestSuite;
public class AST2TemplateTests extends AST2TestBase {
public AST2TemplateTests() {
@ -360,7 +360,7 @@ public class AST2TemplateTests extends AST2TestBase {
assertInstances(col, T1, 6);
}
// template<typename _A_>
// struct A : public _A_::member_t {};
//
@ -6086,7 +6086,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testTemplateAmbiguityInDeleteExpression_364225() throws Exception {
parseAndCheckBindings();
}
// template<int, int> struct a {};
// const int b = 0, c = 1;
// int a<b<c,b<c>::*mp6; // syntax error here
@ -7327,7 +7327,7 @@ public class AST2TemplateTests extends AST2TestBase {
assertEquals("bool", ASTTypeUtil.getType(td.getType()));
ah.assertProblem("B<int*>::type", "type");
}
// constexpr int f() { return 1; }
//
// template <int>
@ -7417,7 +7417,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSfinaeInTemplatedConversionOperator_409056() throws Exception {
parseAndCheckImplicitNameBindings();
}
// template<typename T>
// struct A {
// static constexpr bool value = false;
@ -7551,7 +7551,7 @@ public class AST2TemplateTests extends AST2TestBase {
// static int test(...);
//
// struct A {
// A() = delete;
// A() = delete;
// };
//
// int waldo(int p);
@ -7560,7 +7560,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSfinaeInNewExpressionWithDeletedConstructor_430230() throws Exception {
parseAndCheckBindings();
}
// template<typename _From>
// struct is_convertible {};
//
@ -7585,7 +7585,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSfinaeInIdExpression_459940() throws Exception {
parseAndCheckBindings();
}
// template <typename>
// struct M {
// template <typename... Args>
@ -7894,7 +7894,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testVariadicTemplatesAndFunctionObjects_401479() throws Exception {
parseAndCheckBindings();
}
// template<typename _Tp>
// _Tp declval() noexcept;
//
@ -8018,7 +8018,7 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
helper.assertProblem("bind(s, 0, foo)", "bind");
}
// struct a3 {
// int xxx;
// };
@ -8139,7 +8139,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testParameterPackInNestedTemplate_441028() throws Exception {
parseAndCheckBindings();
}
// template <typename... Args>
// void waldo(Args...);
//
@ -8150,7 +8150,7 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = getAssertionHelper();
helper.assertProblem("waldo<int>()", "waldo<int>");
}
// // Example 1
// template <typename... T>
// void foo1(T... t) {
@ -8158,7 +8158,7 @@ public class AST2TemplateTests extends AST2TestBase {
// }
//
// // Example 2
// template <typename> struct A {};
// template <typename> struct A {};
// template <typename... T>
// void foo2(A<T>... t) {
// bar(t.waldo...);
@ -8240,7 +8240,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testUnqualifiedFunctionCallInTemplate_402498a() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// auto foo(T t) -> decltype(bar(t));
//
@ -8287,7 +8287,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testUnqualifiedFunctionCallInTemplate_458316a() throws Exception {
parseAndCheckBindings();
}
// void bar();
//
// template <typename T>
@ -8307,7 +8307,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testUnqualifiedFunctionCallInTemplate_458316b() throws Exception {
parseAndCheckBindings();
}
// template <typename>
// struct no_type {};
//
@ -8597,7 +8597,7 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = getAssertionHelper();
helper.assertNonProblem("waldo<T>", ICPPDeferredFunction.class);
}
// template <typename>
// struct C {
// friend bool operator==(C, C);
@ -8614,7 +8614,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testStrayFriends_419301() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// constexpr T t(T) {
// return 0;
@ -8631,7 +8631,7 @@ public class AST2TemplateTests extends AST2TestBase {
ICPPVariable waldo = helper.assertNonProblem("waldo");
assertConstantValue(2, waldo);
}
// struct Test {
// static constexpr unsigned calc_sig(const char *s, unsigned n) {
// return (n == 0 || *s == '\0' ? 0 :
@ -8654,7 +8654,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testConstexprFunctionCallWithNonConstexprArguments_429891() throws Exception {
parseAndCheckBindings();
}
// template <typename> class A {};
// template <int> class B {};
// const int D = 4;
@ -8704,7 +8704,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testLocalTypeAsTemplateArgument_442832() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// struct Bar {};
//
@ -8713,11 +8713,11 @@ public class AST2TemplateTests extends AST2TestBase {
// Bar<decltype(t.foo)> bar; // bogus `invalid template arguments` error here
// return bar;
// }
//
//
// struct S {
// int foo;
// };
//
//
// int main() {
// Bar<int> var1;
// auto var2 = foo(S());
@ -8728,7 +8728,7 @@ public class AST2TemplateTests extends AST2TestBase {
IVariable var2 = helper.assertNonProblem("var2");
assertSameType(var1.getType(), var2.getType());
}
// template <bool>
// struct integral_constant {
// static const bool value = true;
@ -8762,7 +8762,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testClassSpecializationInEnumerator_457511() throws Exception {
parseAndCheckBindings();
}
// template <typename> struct TypeTemplate {};
// template <int> struct Size_tTemplate {};
//

View file

@ -16,8 +16,6 @@ package org.eclipse.cdt.internal.index.tests;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
@ -70,6 +68,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.core.runtime.CoreException;
import junit.framework.TestSuite;
/**
* Tests for exercising resolution of template bindings against IIndex
*/
@ -467,7 +467,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// struct A {
// typedef T t;
// };
// template<typename T>
// struct B {};
//
@ -2449,14 +2449,14 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
public void testNPE_407497() throws Exception {
checkBindings();
}
// template <typename>
// struct basic_A {
// bool eof() const;
// };
//
// typedef basic_A<char> A;
// class B : public A {};
//
// class C : public A, public B {};
@ -2531,7 +2531,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
public void testFriendFunctionOfClassSpecialization_419301b() throws Exception {
checkBindings();
}
// template <typename T>
// constexpr T t(T) {
// return 0;
@ -2541,12 +2541,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// constexpr unsigned t<unsigned>(unsigned) {
// return 1 + 1;
// }
// // empty source file
public void testSpecializationOfConstexprFunction_420995() throws Exception {
checkBindings();
}
// template <class TYPE>
// class waldo {
// enum {
@ -2567,46 +2567,46 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
//
// template <>
// struct meta<int> {};
// int z;
public void testEnumerationWithMultipleEnumerators_434467() throws Exception {
checkBindings();
}
// template <typename ResultT, ResultT (*Func)()>
// struct Base {
// ResultT operator()() const;
// };
//
//
// struct S {};
//
//
// template <typename T>
// class B {};
//
//
// template<typename T>
// B<T> f();
//
//
// template <typename T>
// class Derived : public Base<B<S>, f<T> > {};
// const Derived<S> decl;
//
//
// void bar(const B<S>&);
//
//
// void foo() {
// bar(decl()); // ERROR HERE: Invalid arguments
// }
public void testInstantiationOfFunctionInstance_437675() throws Exception {
checkBindings();
}
// struct IID { };
//
//
// struct IUnknown {};
//
//
// template<class T>
// class IID_DUMMY : IID { };
//
//
// template<class T>
// const IID &__uuidof(T x) { return IID_DUMMY<T>(); }
//
@ -2617,16 +2617,15 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
//
// template <class T, const IID* piid = &__uuidof<T> >
// class MYCComQIPtr : public MYCComPtr<T> {};
//
//
// template<>
// class MYCComQIPtr<IUnknown, &IID_IUnknown> : public MYCComPtr<IUnknown> {};
// // source file is deliberately empty
public void testInfiniteRecursionMarshallingTemplateDefinition_439923() throws Exception {
checkBindings();
}
// template <typename T>
// struct Bar {};
//
@ -2635,11 +2634,11 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// Bar<decltype(t.foo)> bar; // bogus `invalid template arguments` error here
// return bar;
// }
//
//
// struct S {
// int foo;
// };
// int main() {
// Bar<int> var1;
// auto var2 = foo(S());