// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s template struct A { void f() { } struct N { }; // expected-note{{target of using declaration}} }; template struct B : A { using A::f; using A::N; // expected-error{{dependent using declaration resolved to type without 'typename'}} using A::foo; // expected-error{{no member named 'foo'}} using A::f; // expected-error{{using declaration refers into 'A::', which is not a base class of 'B'}} }; B a; // expected-note{{in instantiation of template class 'B' requested here}} template struct C : A { using A::f; void f() { }; }; template struct D : A { using A::f; void f(); }; template void D::f() { } template struct E : A { using A::f; void g() { f(); } }; namespace test0 { struct Base { int foo; }; template struct E : Base { using Base::foo; }; template struct E; } // PR7896 namespace PR7896 { template struct Foo { int k (float); }; struct Baz { int k (int); }; template struct Bar : public Foo, Baz { using Foo::k; using Baz::k; int foo() { return k (1.0f); } }; template int Bar::foo(); } // PR10883 namespace PR10883 { template class Base { public: typedef long Container; }; template class Derived : public Base { public: using Base::Container; void foo(const Container& current); // expected-error {{unknown type name 'Container'}} }; } template class UsingTypenameNNS { using typename T::X; typename X::X x; }; namespace aliastemplateinst { template struct A { }; template using APtr = A; // expected-note{{previous use is here}} template struct APtr; // expected-error{{type alias template 'APtr' cannot be referenced with a struct specifier}} } namespace DontDiagnoseInvalidTest { template struct Base { static_assert(Value, ""); // expected-error {{static assertion failed}} }; struct Derived : Base { // expected-note {{requested here}} using Base::Base; // OK. Don't diagnose that 'Base' isn't a base class of Derived. }; } // namespace DontDiagnoseInvalidTest namespace shadow_nested_operator { template struct A { struct Nested {}; operator Nested*() {return 0;}; }; template struct B : A { using A::operator typename A::Nested*; operator typename A::Nested *() { struct A * thi = this; return *thi; }; }; int foo () { struct B b; auto s = *b; } } // namespace shadow_nested_operator namespace func_templ { namespace sss { double foo(int, double); template T foo(T); } // namespace sss namespace oad { void foo(); } namespace oad { using sss::foo; } namespace sss { using oad::foo; } namespace sss { double foo(int, double) { return 0; } // There used to be an error with the below declaration when the example should // be accepted. template T foo(T t) { // OK return t; } } // namespace sss } // namespace func_templ