[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / Parser / cxx-using-declaration.cpp
blob17237a3b9b2b266a2c683118818780a1eef29ba9
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 namespace A {
4 int VA;
5 void FA() {}
6 struct SA { int V; };
9 using A::VA;
10 using A::FA;
11 using typename A::SA;
13 int main()
15 VA = 1;
16 FA();
17 SA x; //Still needs handling.
20 struct B {
21 void f(char){};
22 void g(char){};
24 struct D : B {
25 using B::f;
26 void f(int);
27 void g(int);
29 void D::f(int) { f('c'); } // calls B::f(char)
30 void D::g(int) { g('c'); } // recursively calls D::g(int)
32 namespace E {
33 template <typename TYPE> int funcE(TYPE arg) { return(arg); }
36 using E::funcE<int>; // expected-error{{using declaration cannot refer to a template specialization}}
38 namespace F {
39 struct X;
42 using F::X;
43 // Should have some errors here. Waiting for implementation.
44 void X(int);
45 struct X *x;
48 namespace ShadowedTagNotes {
50 namespace foo {
51 class Bar {};
54 void Bar(int); // expected-note{{class 'Bar' is hidden by a non-type declaration of 'Bar' here}}
55 using foo::Bar;
57 void ambiguity() {
58 const Bar *x; // expected-error{{must use 'class' tag to refer to type 'Bar' in this scope}}
61 } // namespace ShadowedTagNotes