31 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3template<typename T>4struct X {5 void mf1(T);6 template<typename U> void mf2(T, U); // expected-note{{previous}}7};8 9template<>10void X<int>::mf1(int i = 17) // expected-error{{default}}11{12}13 14template<> template<>15void X<int>::mf2(int, int = 17) // expected-error{{default}}16{ }17 18template<> template<typename U> 19void X<int>::mf2(int, U = U()) // expected-error{{default}}20{21}22 23template<>24struct X<float> {25 void mf1(float);26};27 28void X<float>::mf1(float = 3.14f) // okay29{30}31