1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
3 template<typename T
> struct A
{
5 struct N
{ }; // expected-note{{target of using declaration}}
8 template<typename T
> struct B
: A
<T
> {
10 using A
<T
>::N
; // expected-error{{dependent using declaration resolved to type without 'typename'}}
12 using A
<T
>::foo
; // expected-error{{no member named 'foo'}}
13 using A
<double>::f
; // expected-error{{using declaration refers into 'A<double>::', which is not a base class of 'B<int>'}}
16 B
<int> a
; // expected-note{{in instantiation of template class 'B<int>' requested here}}
18 template<typename T
> struct C
: A
<T
> {
24 template <typename T
> struct D
: A
<T
> {
30 template<typename T
> void D
<T
>::f() { }
32 template<typename T
> struct E
: A
<T
> {
42 template<typename T
> struct E
: Base
{
46 template struct E
<int>;
51 template <class T
> struct Foo
{
57 template <class T
> struct Bar
: public Foo
<T
>, Baz
{
64 template int Bar
<int>::foo();
72 typedef long Container
;
76 class Derived
: public Base
<T
> {
78 using Base
<T
>::Container
;
80 void foo(const Container
& current
); // expected-error {{unknown type name 'Container'}}
84 template<typename T
> class UsingTypenameNNS
{
89 namespace aliastemplateinst
{
90 template<typename T
> struct A
{ };
91 template<typename T
> using APtr
= A
<T
*>; // expected-note{{previous use is here}}
93 template struct APtr
<int>; // expected-error{{type alias template 'APtr' cannot be referenced with a struct specifier}}
96 namespace DontDiagnoseInvalidTest
{
97 template <bool Value
> struct Base
{
98 static_assert(Value
, ""); // expected-error {{static assertion failed}}
100 struct Derived
: Base
<false> { // expected-note {{requested here}}
101 using Base
<false>::Base
; // OK. Don't diagnose that 'Base' isn't a base class of Derived.
103 } // namespace DontDiagnoseInvalidTest
105 namespace shadow_nested_operator
{
106 template <typename T
>
109 operator Nested
*() {return 0;};
112 template <typename T
>
114 using A
<T
>::operator typename A
<T
>::Nested
*;
115 operator typename A
<T
>::Nested
*() {
116 struct A
<T
> * thi
= this;
125 } // namespace shadow_nested_operator
127 namespace func_templ
{
129 double foo(int, double);
147 double foo(int, double) { return 0; }
148 // There used to be an error with the below declaration when the example should
155 } // namespace func_templ