instantiation-default-3.cpp 333 B

12345678910111213141516171819202122
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // expected-no-diagnostics
  3. template<typename T> struct A { };
  4. template<typename T, typename U = A<T*> >
  5. struct B : U { };
  6. template<>
  7. struct A<int*> {
  8. void foo();
  9. };
  10. template<>
  11. struct A<float*> {
  12. void bar();
  13. };
  14. void test(B<int> *b1, B<float> *b2) {
  15. b1->foo();
  16. b2->bar();
  17. }