blob: f71ab16c0f17383146f019fd4defa388bbed7dec [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
Sebastian Redl08905022011-02-05 19:23:19 +00002
3struct B1 {
4 B1(int);
5 B1(int, int);
6};
7struct D1 : B1 {
Richard Smithc2bc61b2013-03-18 21:12:30 +00008 using B1::B1;
Sebastian Redl08905022011-02-05 19:23:19 +00009};
10D1 d1a(1), d1b(1, 1);
11
12D1 fd1() { return 1; }
13
14struct B2 {
15 explicit B2(int, int = 0, int = 0);
16};
Sebastian Redl22653ba2011-08-30 19:58:05 +000017struct D2 : B2 { // expected-note 2 {{candidate constructor}}
Richard Smithc2bc61b2013-03-18 21:12:30 +000018 using B2::B2;
Sebastian Redl08905022011-02-05 19:23:19 +000019};
20D2 d2a(1), d2b(1, 1), d2c(1, 1, 1);
21
22D2 fd2() { return 1; } // expected-error {{no viable conversion}}
23
24struct B3 {
25 B3(void*); // expected-note {{inherited from here}}
26};
Sebastian Redl22653ba2011-08-30 19:58:05 +000027struct D3 : B3 { // expected-note 2 {{candidate constructor}}
Richard Smithc2bc61b2013-03-18 21:12:30 +000028 using B3::B3; // expected-note {{candidate constructor (inherited)}}
Sebastian Redl08905022011-02-05 19:23:19 +000029};
30D3 fd3() { return 1; } // expected-error {{no viable conversion}}
Richard Smith23d55872012-04-02 01:30:27 +000031
32template<typename T> struct T1 : B1 {
Richard Smithc2bc61b2013-03-18 21:12:30 +000033 using B1::B1;
Richard Smith23d55872012-04-02 01:30:27 +000034};
35template<typename T> struct T2 : T1<T> {
Richard Smithc2bc61b2013-03-18 21:12:30 +000036 using T1<int>::T1;
Richard Smith23d55872012-04-02 01:30:27 +000037};
38template<typename T> struct T3 : T1<int> {
Richard Smithc2bc61b2013-03-18 21:12:30 +000039 using T1<T>::T1;
Richard Smith23d55872012-04-02 01:30:27 +000040};
41struct U {
42 friend T1<int>::T1(int);
43 friend T1<int>::T1(int, int);
44 friend T2<int>::T2(int);
45 friend T2<int>::T2(int, int);
46 friend T3<int>::T3(int);
47 friend T3<int>::T3(int, int);
48};