1 // RUN: %clang_cc1 %s -pedantic -ast-dump -verify | FileCheck %s
3 __constant int g1; // expected-error {{variable in constant address space must be initialized}}
8 //CHECK: CXXConstructorDecl
10 //CHECK-SAME: X 'void (){{.*}} __generic'
11 X() /*__generic*/ : x(0) {}
12 //CHECK: CXXConstructorDecl {{.*}} used X 'void (){{.*}} __private'
13 X() __private : x(0) {}
14 //CHECK: CXXConstructorDecl {{.*}} used X 'void (){{.*}} __global'
15 X() __global : x(0) {}
16 constexpr X() __constant : x(0) {}
17 constexpr X(int x) __constant : x(x) {}
22 //expected-note@+2{{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const __generic Y' for 1st argument}}
23 //expected-note@+1{{candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to '__generic Y' for 1st argument}}
26 Y() __generic = default; // expected-note{{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
38 __constant Y cy1; // expected-error{{variable in constant address space must be initialized}}
39 __constant Y cy2(1); // expected-error{{no matching constructor for initialization of '__constant Y'}}
44 // The address space is deduced to be __generic if omitted
45 Z() = default; // expected-note{{previous definition is here}}
46 Z() __generic = default; // expected-error {{constructor cannot be redeclared}}
48 Z() __private = default;
49 Z() __local = default;
50 Z() __global = default;
51 // Can't default constexpr constructors
52 constexpr Z() __constant : z(0) {}
57 constexpr W() __constant = default; // expected-error {{defaulted definition of default constructor cannot be marked constexpr}}