From 7bc5a81935b3d810afcb2653760e7134ef45e822 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Mon, 4 May 2015 18:29:47 -0700 Subject: [PATCH] Cosmetics. --- .../parser/tests/ast2/AST2TemplateTests.java | 52 +++++++++---------- .../tests/IndexCPPTemplateResolutionTest.java | 51 +++++++++--------- 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index a5208a0d990..61b71b28cbf 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -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 // struct A : public _A_::member_t {}; // @@ -6086,7 +6086,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testTemplateAmbiguityInDeleteExpression_364225() throws Exception { parseAndCheckBindings(); } - + // template struct a {}; // const int b = 0, c = 1; // int a::*mp6; // syntax error here @@ -7327,7 +7327,7 @@ public class AST2TemplateTests extends AST2TestBase { assertEquals("bool", ASTTypeUtil.getType(td.getType())); ah.assertProblem("B::type", "type"); } - + // constexpr int f() { return 1; } // // template @@ -7417,7 +7417,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testSfinaeInTemplatedConversionOperator_409056() throws Exception { parseAndCheckImplicitNameBindings(); } - + // template // 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 // struct is_convertible {}; // @@ -7585,7 +7585,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testSfinaeInIdExpression_459940() throws Exception { parseAndCheckBindings(); } - + // template // struct M { // template @@ -7894,7 +7894,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testVariadicTemplatesAndFunctionObjects_401479() throws Exception { parseAndCheckBindings(); } - + // template // _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 // void waldo(Args...); // @@ -8150,7 +8150,7 @@ public class AST2TemplateTests extends AST2TestBase { BindingAssertionHelper helper = getAssertionHelper(); helper.assertProblem("waldo()", "waldo"); } - + // // Example 1 // template // void foo1(T... t) { @@ -8158,7 +8158,7 @@ public class AST2TemplateTests extends AST2TestBase { // } // // // Example 2 - // template struct A {}; + // template struct A {}; // template // void foo2(A... t) { // bar(t.waldo...); @@ -8240,7 +8240,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testUnqualifiedFunctionCallInTemplate_402498a() throws Exception { parseAndCheckBindings(); } - + // template // 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 @@ -8307,7 +8307,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testUnqualifiedFunctionCallInTemplate_458316b() throws Exception { parseAndCheckBindings(); } - + // template // struct no_type {}; // @@ -8597,7 +8597,7 @@ public class AST2TemplateTests extends AST2TestBase { BindingAssertionHelper helper = getAssertionHelper(); helper.assertNonProblem("waldo", ICPPDeferredFunction.class); } - + // template // struct C { // friend bool operator==(C, C); @@ -8614,7 +8614,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testStrayFriends_419301() throws Exception { parseAndCheckBindings(); } - + // template // 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 class A {}; // template class B {}; // const int D = 4; @@ -8704,7 +8704,7 @@ public class AST2TemplateTests extends AST2TestBase { public void testLocalTypeAsTemplateArgument_442832() throws Exception { parseAndCheckBindings(); } - + // template // struct Bar {}; // @@ -8713,11 +8713,11 @@ public class AST2TemplateTests extends AST2TestBase { // Bar bar; // bogus `invalid template arguments` error here // return bar; // } - // + // // struct S { // int foo; // }; - // + // // int main() { // Bar 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 // 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 struct TypeTemplate {}; // template struct Size_tTemplate {}; // diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java index 9016b33c6a5..6faf3af4167 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java @@ -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 // struct B {}; // @@ -2449,14 +2449,14 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa public void testNPE_407497() throws Exception { checkBindings(); } - + // template // struct basic_A { // bool eof() const; // }; // // typedef basic_A 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 // constexpr T t(T) { // return 0; @@ -2541,12 +2541,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa // constexpr unsigned t(unsigned) { // return 1 + 1; // } - + // // empty source file public void testSpecializationOfConstexprFunction_420995() throws Exception { checkBindings(); } - + // template // class waldo { // enum { @@ -2567,46 +2567,46 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa // // template <> // struct meta {}; - + // int z; public void testEnumerationWithMultipleEnumerators_434467() throws Exception { checkBindings(); } - + // template // struct Base { // ResultT operator()() const; // }; - // + // // struct S {}; - // + // // template // class B {}; - // + // // template // B f(); - // + // // template // class Derived : public Base, f > {}; // const Derived decl; - // + // // void bar(const B&); - // + // // void foo() { // bar(decl()); // ERROR HERE: Invalid arguments // } public void testInstantiationOfFunctionInstance_437675() throws Exception { checkBindings(); } - + // struct IID { }; - // + // // struct IUnknown {}; - // + // // template // class IID_DUMMY : IID { }; - // + // // template // const IID &__uuidof(T x) { return IID_DUMMY(); } // @@ -2617,16 +2617,15 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa // // template > // class MYCComQIPtr : public MYCComPtr {}; - // + // // template<> // class MYCComQIPtr : public MYCComPtr {}; - + // // source file is deliberately empty public void testInfiniteRecursionMarshallingTemplateDefinition_439923() throws Exception { checkBindings(); } - - + // template // struct Bar {}; // @@ -2635,11 +2634,11 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa // Bar bar; // bogus `invalid template arguments` error here // return bar; // } - // + // // struct S { // int foo; // }; - + // int main() { // Bar var1; // auto var2 = foo(S());