p7.cpp 839 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // PR5741
  3. namespace test0 {
  4. struct A {
  5. struct B { };
  6. struct C;
  7. };
  8. struct A::C : B { };
  9. }
  10. // Test that successive base specifiers don't screw with each other.
  11. namespace test1 {
  12. struct Opaque1 {};
  13. struct Opaque2 {};
  14. struct A {
  15. struct B { B(Opaque1); };
  16. };
  17. struct B {
  18. B(Opaque2);
  19. };
  20. struct C : A, B {
  21. // Apparently the base-or-member lookup is actually ambiguous
  22. // without this qualification.
  23. C() : A(), test1::B(Opaque2()) {}
  24. };
  25. }
  26. // Test that we don't find the injected class name when parsing base
  27. // specifiers.
  28. namespace test2 {
  29. template <class T> struct bar {};
  30. template <class T> struct foo : bar<foo> {}; // expected-error {{use of class template 'foo' requires template arguments}} expected-note {{template is declared here}}
  31. }