1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// { dg-do assemble } class A { private: int i1_; public: void f(int const i1 = 1); // { dg-error "previous specification" } }; void A::f(int const i1 = 1) // { dg-error "default argument given" } { i1_ = i1; } int main() { A a; a.f(); return 0; }