Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | 9d7b353 | 2009-09-28 07:26:33 +0000 | [diff] [blame] | 2 | |
| 3 | // PR5061 |
| 4 | namespace a { |
| 5 | template <typename T> class C {}; |
| 6 | } |
| 7 | namespace b { |
| 8 | template<typename T> void f0(a::C<T> &a0) { } |
| 9 | } |
John McCall | e1599ce | 2009-11-30 23:50:49 +0000 | [diff] [blame] | 10 | |
| 11 | |
| 12 | namespace 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 | } |
John McCall | aa81e16 | 2009-12-01 22:10:20 +0000 | [diff] [blame] | 21 | |
| 22 | namespace test2 { |
| 23 | class Impl { |
John McCall | 7002f4c | 2010-04-09 19:03:51 +0000 | [diff] [blame] | 24 | public: |
John McCall | aa81e16 | 2009-12-01 22:10:20 +0000 | [diff] [blame] | 25 | int foo(); |
| 26 | }; |
| 27 | template <class T> class Magic : public Impl { |
| 28 | int foo() { |
| 29 | return Impl::foo(); |
| 30 | } |
| 31 | }; |
| 32 | } |
Douglas Gregor | 86b8e09 | 2010-01-29 17:15:43 +0000 | [diff] [blame] | 33 | |
| 34 | namespace PR6063 { |
| 35 | template <typename T> void f(T, T); |
| 36 | |
| 37 | namespace detail |
| 38 | { |
| 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 | } |