summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C
new file mode 100644
index 0000000000..5484efce19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C
@@ -0,0 +1,42 @@
+// { dg-options "-std=c++0x" }
+
+// Exercise some member alias templates ...
+
+template<class T, class U> class A0 {};
+
+template<class T>
+struct A1 {
+ template<class U> struct S {};
+ template<class U> using AA0 = A0<T, U>;
+
+ void f(A0<T, int>);
+
+ void
+ foo()
+ {
+ AA0<int> a;
+ const AA0<int> b;
+ f(a);
+ f(b);
+ }
+};
+
+void
+bar()
+{
+ A1<int> a1;
+ a1.foo();
+ A1<int>::AA0<int> a1aa0;
+ a1.f(a1aa0);
+}
+
+// ... some simple member alias ...
+struct B {
+ using A = int;
+};
+
+B::A a;
+
+// ... and some simple alias
+
+using Int = int;