cxx1z-using-declaration.cpp 754 B

1234567891011121314151617181920212223242526272829303132333435
  1. // RUN: %clang_cc1 -std=c++1z -verify %s
  2. namespace A {
  3. int m, n;
  4. };
  5. namespace B {
  6. using A::m, A::n, A::n;
  7. int q = m + n;
  8. }
  9. struct X {
  10. int x1, x2, y, z; // expected-note 2{{conflicting}}
  11. };
  12. struct Y {
  13. int x1, x2, y, z; // expected-note 2{{target}}
  14. };
  15. struct Z : X, Y {
  16. using X::x1,
  17. blah::blah, // expected-error {{undeclared}}
  18. X::x2, // expected-note {{previous}}
  19. Y::y,
  20. X::x2, // expected-error {{redeclaration}}
  21. X::z,
  22. Y::z; // expected-error {{conflicts with}}
  23. };
  24. int X::*px1 = &Z::x1;
  25. int X::*px2 = &Z::x2;
  26. int Y::*py = &Z::y;
  27. int X::*pz = &Z::z;
  28. template<typename ...T> struct Q : T... {
  29. using T::z...; // expected-error {{conflicts}}
  30. };
  31. Q<X,Y> q; // expected-note {{instantiation of}}