Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TypeAliasTests.java')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TypeAliasTests.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TypeAliasTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TypeAliasTests.java
new file mode 100644
index 00000000000..a2c65393d80
--- /dev/null
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TypeAliasTests.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+* Copyright (c) 2016 Institute for Software, HSR Hochschule fuer Technik
+* Rapperswil, University of applied sciences and others
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+package org.eclipse.cdt.core.parser.tests.ast2.cxx14.constexpr;
+
+import junit.framework.TestSuite;
+
+public class TypeAliasTests extends TestBase {
+ public static class NonIndexing extends TypeAliasTests {
+ public NonIndexing() {setStrategy(new NonIndexingTestStrategy());}
+ public static TestSuite suite() {return suite(NonIndexing.class);}
+ }
+
+ public static class SingleProject extends TypeAliasTests {
+ public SingleProject() {setStrategy(new SinglePDOMTestStrategy(true, false));}
+ public static TestSuite suite() {return suite(SingleProject.class);}
+ }
+
+ // constexpr int f() {
+ // typedef int myint;
+ // myint x = 5;
+ // x *= 5;
+ // return x;
+ // }
+
+ // constexpr int x = f();
+ public void testTypedefDeclaration() throws Exception {
+ assertEvaluationEquals(25);
+ }
+
+ // constexpr int f() {
+ // using myint = int;
+ // myint x = 5;
+ // x *= 5;
+ // return x;
+ // }
+
+ // constexpr int x = f();
+ public void testAliasDeclaration() throws Exception {
+ assertEvaluationEquals(25);
+ }
+} \ No newline at end of file

Back to the top