aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p6.cpp
blob: 00234ac5fd162505e002fad673e537a815326c43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: %clang_cc1 -fsyntax-only -verify %s

class C { 
  void f(int i = 3); // expected-note{{here}}
  void g(int i, int j = 99);
};

void C::f(int i = 3) { } // expected-error{{redefinition of default argument}}

void C::g(int i = 88, int j) { }

void test_C(C c) {
  c.f();
  c.g();
}

template<typename T>
struct X0 {
  void f(int);
  
  struct Inner {
    void g(int);
  };
};

// DR217
template<typename T>
void X0<T>::f(int = 17) { } // expected-error{{cannot be added}}

// DR217 + DR205 (reading tea leaves)
template<typename T>
void X0<T>::Inner::g(int = 17) { } // expected-error{{cannot be added}}