what does standard say about such case:
template<class C>
struct A {
A(C c = C());
};
struct C {
C(int);
};
A<C> a(C(1));
btw, Comeau does not raise error.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you don’t use the default argument (that is, you supply a value), then it is not instantiated at all.
14.7.1/2:
What a mouthful. Actually, default arguments of both functions and templates have specific instantiation rules all to themselves.