OSDN Git Service

PR c++/45114 - Support C++11 alias-declaration
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / alias-decl-0.C
1 // { dg-options "-std=c++0x" }
2
3 template<template<class> class TT> struct X { };
4 template<class> struct Y { };
5 template<class T> using Z = Y<T>;
6
7 void f(X<Y>);
8 void g(X<Z>);
9
10 void
11 foo()
12 {
13     // Below x and y don't have the same type, because Y and Z don't
14     // designate the same template ...
15     X<Y> y; 
16     X<Z> z;
17
18     // ... So these must fail to compile.
19     f(z);   // { dg-error "" }
20     g(y);   // { dg-error "" }
21 }
22
23 template<class> struct A0 {};
24 template<class T> using AA0 = A0<T>;
25 template<class T> using AAA0 = AA0<T>;
26
27 void f0(A0<int>);
28 void
29 g0()
30 {
31   AA0<int> a;
32   AAA0<int> b;
33   f0(a);
34   f0(b);
35 }
36
37