]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CXX/class.access/class.friend/p3-cxx0x.cpp
Vendor import of clang release_30 branch r142614:
[FreeBSD/FreeBSD.git] / test / CXX / class.access / class.friend / p3-cxx0x.cpp
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
2 template<typename T>
3 class X0 {
4   friend T;
5 };
6
7 class Y1 { };
8 enum E1 { };
9 X0<Y1> x0a;
10 X0<Y1 *> x0b;
11 X0<int> x0c;
12 X0<E1> x0d;
13
14 template<typename T>
15 class X1 {
16   friend typename T::type; // expected-error{{no type named 'type' in 'Y1'}}
17 };
18
19 struct Y2 {
20   struct type { };
21 };
22
23 struct Y3 {
24   typedef int type;
25 };
26
27 X1<Y2> x1a;
28 X1<Y3> x1b;
29 X1<Y1> x1c; // expected-note{{in instantiation of template class 'X1<Y1>' requested here}}