]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p2-0x.cpp
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / CXX / dcl.dcl / dcl.spec / dcl.type / dcl.type.elab / p2-0x.cpp
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2
3 struct A { typedef int type; };
4 template<typename T> using X = A; // expected-note {{declared here}}
5 struct X<int>* p2; // expected-error {{type alias template 'X' cannot be referenced with a struct specifier}}
6
7
8 template<typename T> using Id = T; // expected-note {{declared here}}
9 template<template<typename> class F>
10 struct Y {
11   struct F<int> i; // expected-error {{type alias template 'Id' cannot be referenced with a struct specifier}}
12   typename F<A>::type j; // ok
13
14   // FIXME: don't produce the diagnostic both for the definition and the instantiation.
15   template<typename T> using U = F<char>; // expected-note 2{{declared here}}
16   struct Y<F>::template U<char> k; // expected-error 2{{type alias template 'U' cannot be referenced with a struct specifier}}
17   typename Y<F>::template U<char> l; // ok
18 };
19 template struct Y<Id>; // expected-note {{requested here}}