1762bb9d0ad20320b9f97a841dce57ba5e8e48b07Richard Smith// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl
3f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl// Straight from the standard
4f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redlstruct B1 {
5c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smith  B1(int); // expected-note {{previous constructor}} expected-note {{conflicting constructor}}
6f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl};
7f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redlstruct B2 {
8f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl  B2(int); // expected-note {{conflicting constructor}}
9f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl};
10f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redlstruct D1 : B1, B2 {
1107b0fdcee8d64222b274779d02851cc53d18e0dbRichard Smith  using B1::B1; // expected-note {{inherited here}}
1207b0fdcee8d64222b274779d02851cc53d18e0dbRichard Smith  using B2::B2; // expected-error {{already inherited constructor with the same signature}}
13f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl};
14f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redlstruct D2 : B1, B2 {
1507b0fdcee8d64222b274779d02851cc53d18e0dbRichard Smith  using B1::B1;
1607b0fdcee8d64222b274779d02851cc53d18e0dbRichard Smith  using B2::B2;
17f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl  D2(int);
18f677ea3cc9598d9952ad7ffab5fb322ba4c5be31Sebastian Redl};
19c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smith
20c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smithtemplate<typename T> struct B3 {
21c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smith  B3(T); // expected-note {{previous constructor}}
22c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smith};
23c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smithtemplate<typename T> struct B4 : B3<T>, B1 {
24c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smith  B4();
2507b0fdcee8d64222b274779d02851cc53d18e0dbRichard Smith  using B3<T>::B3; // expected-note {{inherited here}}
2607b0fdcee8d64222b274779d02851cc53d18e0dbRichard Smith  using B1::B1; // expected-error {{already inherited}}
27c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard Smith};
28c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard SmithB4<char> b4c;
29c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5Richard SmithB4<int> b4i; // expected-note {{here}}
304841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith
314841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smithstruct B5 {
324841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  template<typename T> B5(T); // expected-note {{previous constructor}}
334841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith};
344841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smithstruct B6 {
354841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  template<typename T> B6(T); // expected-note {{conflicting constructor}}
364841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith};
374841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smithstruct B7 {
384841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  template<typename T, int> B7(T);
394841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith};
404841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smithstruct D56 : B5, B6, B7 {
414841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  using B5::B5; // expected-note {{inherited here}}
424841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  using B6::B6; // expected-error {{already inherited}}
434841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith};
444841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smithstruct D57 : B5, B6, B7 {
454841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  using B5::B5;
464841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith  using B7::B7; // ok, not the same signature
474841ca5f83bf970f910ac7d154cdd71d2a3cf481Richard Smith};
48