p3.cpp revision 3e4c6c4c79a03f5cb0c4671d7c282d623c6dc35e
15c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s 25c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu 35c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// The example given in the standard (this is rejected for other reasons anyway). 45c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liutemplate<class T> struct A; 55c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liutemplate<class T> using B = typename A<T>::U; // expected-error {{no type named 'U' in 'A<T>'}} 65c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liutemplate<class T> struct A { 75c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu typedef B<T> U; // expected-note {{in instantiation of template type alias 'B' requested here}} 85c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu}; 95c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo LiuB<short> b; 105c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu 115c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liutemplate<typename T> using U = int; 125c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// FIXME: This is illegal, but probably only because CWG1044 missed this paragraph. 135c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liutemplate<typename T> using U = U<T>; 146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)