58 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// PR50614namespace a {5 template <typename T> class C {};6}7namespace b {8 template<typename T> void f0(a::C<T> &a0) { }9}10 11 12namespace test1 {13 int a = 0;14 template <class T> class Base { };15 template <class T> class Derived : public Base<T> {16 int foo() {17 return test1::a;18 }19 };20}21 22namespace test2 {23 class Impl {24 public:25 int foo();26 };27 template <class T> class Magic : public Impl {28 int foo() {29 return Impl::foo();30 }31 };32}33 34namespace PR6063 {35 template <typename T> void f(T, T);36 37 namespace detail38 {39 using PR6063::f;40 }41 42 template <typename T>43 void g(T a, T b)44 {45 detail::f(a, b);46 }47}48 49namespace PR12291 {50 template <typename T>51 class Outer2 {52 template <typename V>53 template <typename W>54 class Outer2<V>::Inner; // expected-error{{nested name specifier 'Outer2<V>' for declaration does not refer into a class, class template or class template partial specialization}}55 // expected-error@-1{{forward declaration of class cannot have a nested name specifier}}56 };57}58