Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
John Thompson | 59cbea9 | 2009-10-13 05:45:19 +0000 | [diff] [blame] | 2 | |
| 3 | namespace A { |
| 4 | int VA; |
| 5 | void FA() {} |
| 6 | struct SA { int V; }; |
| 7 | } |
| 8 | |
| 9 | using A::VA; |
| 10 | using A::FA; |
| 11 | using typename A::SA; |
| 12 | |
Douglas Gregor | 67f44b1 | 2009-11-25 19:28:08 +0000 | [diff] [blame] | 13 | int main() |
John Thompson | 59cbea9 | 2009-10-13 05:45:19 +0000 | [diff] [blame] | 14 | { |
| 15 | VA = 1; |
| 16 | FA(); |
| 17 | SA x; //Still needs handling. |
| 18 | } |
| 19 | |
| 20 | struct B { |
| 21 | void f(char){}; |
| 22 | void g(char){}; |
| 23 | }; |
| 24 | struct D : B { |
| 25 | using B::f; |
| 26 | void f(int); |
| 27 | void g(int); |
| 28 | }; |
| 29 | void D::f(int) { f('c'); } // calls B::f(char) |
| 30 | void D::g(int) { g('c'); } // recursively calls D::g(int) |
| 31 | |
| 32 | namespace E { |
| 33 | template <typename TYPE> int funcE(TYPE arg) { return(arg); } |
| 34 | } |
| 35 | |
Douglas Gregor | 67f44b1 | 2009-11-25 19:28:08 +0000 | [diff] [blame] | 36 | using E::funcE<int>; // expected-error{{using declaration can not refer to a template specialization}} |
John Thompson | 59cbea9 | 2009-10-13 05:45:19 +0000 | [diff] [blame] | 37 | |
| 38 | namespace F { |
| 39 | struct X; |
| 40 | } |
| 41 | |
| 42 | using F::X; |
| 43 | // Should have some errors here. Waiting for implementation. |
| 44 | void X(int); |
| 45 | struct X *x; |