1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 05:15:43 +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 java.io.IOException;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; 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.dom.parser.cpp.semantics.SemanticUtil;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
import junit.framework.TestSuite;
public class AST2TemplateTests extends AST2TestBase { public class AST2TemplateTests extends AST2TestBase {
public AST2TemplateTests() { public AST2TemplateTests() {
@ -360,7 +360,7 @@ public class AST2TemplateTests extends AST2TestBase {
assertInstances(col, T1, 6); assertInstances(col, T1, 6);
} }
// template<typename _A_> // template<typename _A_>
// struct A : public _A_::member_t {}; // struct A : public _A_::member_t {};
// //
@ -6086,7 +6086,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testTemplateAmbiguityInDeleteExpression_364225() throws Exception { public void testTemplateAmbiguityInDeleteExpression_364225() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template<int, int> struct a {}; // template<int, int> struct a {};
// const int b = 0, c = 1; // const int b = 0, c = 1;
// int a<b<c,b<c>::*mp6; // syntax error here // 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())); assertEquals("bool", ASTTypeUtil.getType(td.getType()));
ah.assertProblem("B<int*>::type", "type"); ah.assertProblem("B<int*>::type", "type");
} }
// constexpr int f() { return 1; } // constexpr int f() { return 1; }
// //
// template <int> // template <int>
@ -7417,7 +7417,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSfinaeInTemplatedConversionOperator_409056() throws Exception { public void testSfinaeInTemplatedConversionOperator_409056() throws Exception {
parseAndCheckImplicitNameBindings(); parseAndCheckImplicitNameBindings();
} }
// template<typename T> // template<typename T>
// struct A { // struct A {
// static constexpr bool value = false; // static constexpr bool value = false;
@ -7551,7 +7551,7 @@ public class AST2TemplateTests extends AST2TestBase {
// static int test(...); // static int test(...);
// //
// struct A { // struct A {
// A() = delete; // A() = delete;
// }; // };
// //
// int waldo(int p); // int waldo(int p);
@ -7560,7 +7560,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSfinaeInNewExpressionWithDeletedConstructor_430230() throws Exception { public void testSfinaeInNewExpressionWithDeletedConstructor_430230() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template<typename _From> // template<typename _From>
// struct is_convertible {}; // struct is_convertible {};
// //
@ -7585,7 +7585,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testSfinaeInIdExpression_459940() throws Exception { public void testSfinaeInIdExpression_459940() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename> // template <typename>
// struct M { // struct M {
// template <typename... Args> // template <typename... Args>
@ -7894,7 +7894,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testVariadicTemplatesAndFunctionObjects_401479() throws Exception { public void testVariadicTemplatesAndFunctionObjects_401479() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template<typename _Tp> // template<typename _Tp>
// _Tp declval() noexcept; // _Tp declval() noexcept;
// //
@ -8018,7 +8018,7 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
helper.assertProblem("bind(s, 0, foo)", "bind"); helper.assertProblem("bind(s, 0, foo)", "bind");
} }
// struct a3 { // struct a3 {
// int xxx; // int xxx;
// }; // };
@ -8139,7 +8139,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testParameterPackInNestedTemplate_441028() throws Exception { public void testParameterPackInNestedTemplate_441028() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename... Args> // template <typename... Args>
// void waldo(Args...); // void waldo(Args...);
// //
@ -8150,7 +8150,7 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = getAssertionHelper(); BindingAssertionHelper helper = getAssertionHelper();
helper.assertProblem("waldo<int>()", "waldo<int>"); helper.assertProblem("waldo<int>()", "waldo<int>");
} }
// // Example 1 // // Example 1
// template <typename... T> // template <typename... T>
// void foo1(T... t) { // void foo1(T... t) {
@ -8158,7 +8158,7 @@ public class AST2TemplateTests extends AST2TestBase {
// } // }
// //
// // Example 2 // // Example 2
// template <typename> struct A {}; // template <typename> struct A {};
// template <typename... T> // template <typename... T>
// void foo2(A<T>... t) { // void foo2(A<T>... t) {
// bar(t.waldo...); // bar(t.waldo...);
@ -8240,7 +8240,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testUnqualifiedFunctionCallInTemplate_402498a() throws Exception { public void testUnqualifiedFunctionCallInTemplate_402498a() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename T> // template <typename T>
// auto foo(T t) -> decltype(bar(t)); // auto foo(T t) -> decltype(bar(t));
// //
@ -8287,7 +8287,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testUnqualifiedFunctionCallInTemplate_458316a() throws Exception { public void testUnqualifiedFunctionCallInTemplate_458316a() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// void bar(); // void bar();
// //
// template <typename T> // template <typename T>
@ -8307,7 +8307,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testUnqualifiedFunctionCallInTemplate_458316b() throws Exception { public void testUnqualifiedFunctionCallInTemplate_458316b() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename> // template <typename>
// struct no_type {}; // struct no_type {};
// //
@ -8597,7 +8597,7 @@ public class AST2TemplateTests extends AST2TestBase {
BindingAssertionHelper helper = getAssertionHelper(); BindingAssertionHelper helper = getAssertionHelper();
helper.assertNonProblem("waldo<T>", ICPPDeferredFunction.class); helper.assertNonProblem("waldo<T>", ICPPDeferredFunction.class);
} }
// template <typename> // template <typename>
// struct C { // struct C {
// friend bool operator==(C, C); // friend bool operator==(C, C);
@ -8614,7 +8614,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testStrayFriends_419301() throws Exception { public void testStrayFriends_419301() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename T> // template <typename T>
// constexpr T t(T) { // constexpr T t(T) {
// return 0; // return 0;
@ -8631,7 +8631,7 @@ public class AST2TemplateTests extends AST2TestBase {
ICPPVariable waldo = helper.assertNonProblem("waldo"); ICPPVariable waldo = helper.assertNonProblem("waldo");
assertConstantValue(2, waldo); assertConstantValue(2, waldo);
} }
// struct Test { // struct Test {
// static constexpr unsigned calc_sig(const char *s, unsigned n) { // static constexpr unsigned calc_sig(const char *s, unsigned n) {
// return (n == 0 || *s == '\0' ? 0 : // return (n == 0 || *s == '\0' ? 0 :
@ -8654,7 +8654,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testConstexprFunctionCallWithNonConstexprArguments_429891() throws Exception { public void testConstexprFunctionCallWithNonConstexprArguments_429891() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename> class A {}; // template <typename> class A {};
// template <int> class B {}; // template <int> class B {};
// const int D = 4; // const int D = 4;
@ -8704,7 +8704,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testLocalTypeAsTemplateArgument_442832() throws Exception { public void testLocalTypeAsTemplateArgument_442832() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename T> // template <typename T>
// struct Bar {}; // struct Bar {};
// //
@ -8713,11 +8713,11 @@ public class AST2TemplateTests extends AST2TestBase {
// Bar<decltype(t.foo)> bar; // bogus `invalid template arguments` error here // Bar<decltype(t.foo)> bar; // bogus `invalid template arguments` error here
// return bar; // return bar;
// } // }
// //
// struct S { // struct S {
// int foo; // int foo;
// }; // };
// //
// int main() { // int main() {
// Bar<int> var1; // Bar<int> var1;
// auto var2 = foo(S()); // auto var2 = foo(S());
@ -8728,7 +8728,7 @@ public class AST2TemplateTests extends AST2TestBase {
IVariable var2 = helper.assertNonProblem("var2"); IVariable var2 = helper.assertNonProblem("var2");
assertSameType(var1.getType(), var2.getType()); assertSameType(var1.getType(), var2.getType());
} }
// template <bool> // template <bool>
// struct integral_constant { // struct integral_constant {
// static const bool value = true; // static const bool value = true;
@ -8762,7 +8762,7 @@ public class AST2TemplateTests extends AST2TestBase {
public void testClassSpecializationInEnumerator_457511() throws Exception { public void testClassSpecializationInEnumerator_457511() throws Exception {
parseAndCheckBindings(); parseAndCheckBindings();
} }
// template <typename> struct TypeTemplate {}; // template <typename> struct TypeTemplate {};
// template <int> struct Size_tTemplate {}; // 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.ArrayList;
import java.util.List; import java.util.List;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.EScopeKind; import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName; 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.cdt.internal.core.index.IIndexScope;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import junit.framework.TestSuite;
/** /**
* Tests for exercising resolution of template bindings against IIndex * Tests for exercising resolution of template bindings against IIndex
*/ */
@ -467,7 +467,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// struct A { // struct A {
// typedef T t; // typedef T t;
// }; // };
// template<typename T> // template<typename T>
// struct B {}; // struct B {};
// //
@ -2449,14 +2449,14 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
public void testNPE_407497() throws Exception { public void testNPE_407497() throws Exception {
checkBindings(); checkBindings();
} }
// template <typename> // template <typename>
// struct basic_A { // struct basic_A {
// bool eof() const; // bool eof() const;
// }; // };
// //
// typedef basic_A<char> A; // typedef basic_A<char> A;
// class B : public A {}; // class B : public A {};
// //
// class C : public A, public B {}; // class C : public A, public B {};
@ -2531,7 +2531,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
public void testFriendFunctionOfClassSpecialization_419301b() throws Exception { public void testFriendFunctionOfClassSpecialization_419301b() throws Exception {
checkBindings(); checkBindings();
} }
// template <typename T> // template <typename T>
// constexpr T t(T) { // constexpr T t(T) {
// return 0; // return 0;
@ -2541,12 +2541,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// constexpr unsigned t<unsigned>(unsigned) { // constexpr unsigned t<unsigned>(unsigned) {
// return 1 + 1; // return 1 + 1;
// } // }
// // empty source file // // empty source file
public void testSpecializationOfConstexprFunction_420995() throws Exception { public void testSpecializationOfConstexprFunction_420995() throws Exception {
checkBindings(); checkBindings();
} }
// template <class TYPE> // template <class TYPE>
// class waldo { // class waldo {
// enum { // enum {
@ -2567,46 +2567,46 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// //
// template <> // template <>
// struct meta<int> {}; // struct meta<int> {};
// int z; // int z;
public void testEnumerationWithMultipleEnumerators_434467() throws Exception { public void testEnumerationWithMultipleEnumerators_434467() throws Exception {
checkBindings(); checkBindings();
} }
// template <typename ResultT, ResultT (*Func)()> // template <typename ResultT, ResultT (*Func)()>
// struct Base { // struct Base {
// ResultT operator()() const; // ResultT operator()() const;
// }; // };
// //
// struct S {}; // struct S {};
// //
// template <typename T> // template <typename T>
// class B {}; // class B {};
// //
// template<typename T> // template<typename T>
// B<T> f(); // B<T> f();
// //
// template <typename T> // template <typename T>
// class Derived : public Base<B<S>, f<T> > {}; // class Derived : public Base<B<S>, f<T> > {};
// const Derived<S> decl; // const Derived<S> decl;
// //
// void bar(const B<S>&); // void bar(const B<S>&);
// //
// void foo() { // void foo() {
// bar(decl()); // ERROR HERE: Invalid arguments // bar(decl()); // ERROR HERE: Invalid arguments
// } // }
public void testInstantiationOfFunctionInstance_437675() throws Exception { public void testInstantiationOfFunctionInstance_437675() throws Exception {
checkBindings(); checkBindings();
} }
// struct IID { }; // struct IID { };
// //
// struct IUnknown {}; // struct IUnknown {};
// //
// template<class T> // template<class T>
// class IID_DUMMY : IID { }; // class IID_DUMMY : IID { };
// //
// template<class T> // template<class T>
// const IID &__uuidof(T x) { return IID_DUMMY<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> > // template <class T, const IID* piid = &__uuidof<T> >
// class MYCComQIPtr : public MYCComPtr<T> {}; // class MYCComQIPtr : public MYCComPtr<T> {};
// //
// template<> // template<>
// class MYCComQIPtr<IUnknown, &IID_IUnknown> : public MYCComPtr<IUnknown> {}; // class MYCComQIPtr<IUnknown, &IID_IUnknown> : public MYCComPtr<IUnknown> {};
// // source file is deliberately empty // // source file is deliberately empty
public void testInfiniteRecursionMarshallingTemplateDefinition_439923() throws Exception { public void testInfiniteRecursionMarshallingTemplateDefinition_439923() throws Exception {
checkBindings(); checkBindings();
} }
// template <typename T> // template <typename T>
// struct Bar {}; // struct Bar {};
// //
@ -2635,11 +2634,11 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// Bar<decltype(t.foo)> bar; // bogus `invalid template arguments` error here // Bar<decltype(t.foo)> bar; // bogus `invalid template arguments` error here
// return bar; // return bar;
// } // }
// //
// struct S { // struct S {
// int foo; // int foo;
// }; // };
// int main() { // int main() {
// Bar<int> var1; // Bar<int> var1;
// auto var2 = foo(S()); // auto var2 = foo(S());