brintos

brintos / llvm-project-archived public Read only

0
0
Text · 839 B · 9632fda Raw
38 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// PR57414namespace test0 {5  struct A {6    struct B { };7    struct C;8  };9 10  struct A::C : B { };11}12 13// Test that successive base specifiers don't screw with each other.14namespace test1 {15  struct Opaque1 {};16  struct Opaque2 {};17 18  struct A {19    struct B { B(Opaque1); };20  };21  struct B {22    B(Opaque2);23  };24 25  struct C : A, B {26    // Apparently the base-or-member lookup is actually ambiguous27    // without this qualification.28    C() : A(), test1::B(Opaque2()) {}29  };30}31 32// Test that we don't find the injected class name when parsing base33// specifiers.34namespace test2 {35  template <class T> struct bar {};36  template <class T> struct foo : bar<foo> {}; // expected-error {{use of class template 'foo' requires template arguments}} expected-note {{template is declared here}}37}38