File: p1.cpp

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (65 lines) | stat: -rw-r--r-- 1,941 bytes parent folder | download | duplicates (6)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// RUN: %clang_cc1 -std=c++11 -verify %s
//
// Note: [class.inhctor] was removed by P0136R1. This tests the new behavior
// for the wording that used to be there.

struct A { // expected-note 4{{candidate constructor (the implicit}}
  A(...); // expected-note 4{{candidate constructor}} expected-note 4{{candidate inherited constructor}}
  A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}
  A(int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}

  template<typename T> A(T, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}

  template<typename T, int N> A(const T (&)[N]); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}
  template<typename T, int N> A(const T (&)[N], int = 0); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}
};

struct B : A { // expected-note 4{{candidate constructor (the implicit}}
  using A::A; // expected-note 15{{inherited here}}
  B(void*);
};

struct C {} c;

A a0{}; // expected-error {{ambiguous}}
B b0{}; // expected-error {{ambiguous}}

A a1{1}; // expected-error {{ambiguous}}
B b1{1}; // expected-error {{ambiguous}}

A a2{1,2}; // expected-error {{ambiguous}}
B b2{1,2}; // expected-error {{ambiguous}}

A a3{1,2,3}; // ok
B b3{1,2,3}; // ok

A a4{1,2,3,4}; // ok
B b4{1,2,3,4}; // ok

A a5{1,2,3,4,5}; // ok
B b5{1,2,3,4,5}; // ok

A a6{c}; // ok
B b6{c}; // ok

A a7{c,0}; // ok
B b7{c,0}; // ok

A a8{c,0,1}; // ok
B b8{c,0,1}; // ok

A a9{"foo"}; // expected-error {{ambiguous}}
B b9{"foo"}; // expected-error {{ambiguous}}

namespace PR15755 {
  struct X {
    template<typename...Ts> X(int, Ts...);
  };
  struct Y : X {
    using X::X;
  };
  struct Z : Y {
    using Y::Y;
  };
  Z z(0);
}