brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b9b29d2 Raw
35 lines · cpp
1// RUN: %clang_cc1 -verify=expected,precxx17 %std_cxx98-14 %s2// RUN: %clang_cc1 -verify=expected,cxx17 %std_cxx17- %s3 4template <class T> struct Base {5  // expected-note@-1 2{{member type 'Base<int>' found by ambiguous name lookup}}6  // expected-note@-2 2{{member type 'Base<char>' found by ambiguous name lookup}}7  static void f();8};9 10struct X0 { };11 12template <class T> struct Derived: Base<int>, Base<char> {13  typename Derived::Base b;	// expected-error{{member 'Base' found in multiple base classes of different types}}14  typename Derived::Base<double> d;	// OK15 16  void g(X0 *t) {17    t->Derived::Base<T>::f();18    t->Base<T>::f();19    t->Base::f(); // expected-error{{member 'Base' found in multiple base classes of different types}}20  }21};22 23namespace PR6717 {24  template <typename T>25  class WebVector {26  } // expected-error {{expected ';' after class}}27 28    WebVector(const WebVector<T>& other) { } // expected-error{{undeclared identifier 'T'}} \29                                                precxx17-error{{a type specifier is required}} \30                                                cxx17-error{{deduction guide declaration without trailing return type}}31 32  template <typename C>33  WebVector<T>& operator=(const C& other) { } // expected-error{{undeclared identifier 'T'}}34}35