[OpenACC] Create AST nodes for 'data' constructs
[llvm-project.git] / clang / test / CXX / special / class.inhctor / p8.cpp
blobdbc357c1a8d4fcb3beb40972126d05bcb1000f07
1 // RUN: %clang_cc1 -std=c++11 -verify %s
2 //
3 // Note: [class.inhctor] was removed by P0136R1. This tests the new behavior
4 // for the wording that used to be there.
6 struct A {
7 constexpr A(const int&) : rval(false) {}
8 constexpr A(const int&&) : rval(true) {}
9 bool rval;
11 struct B : A {
12 using A::A;
15 constexpr int k = 0;
16 constexpr A a0{0};
17 constexpr A a1{k};
18 constexpr B b0{0};
19 constexpr B b1{k};
21 static_assert(a0.rval && !a1.rval && b0.rval && !b1.rval, "");
23 struct C {
24 template<typename T> constexpr C(T t) : v(t) {}
25 int v;
27 struct D : C { // #defined-here
28 using C::C;
30 static_assert(D(123).v == 123, "");
32 template<typename T> constexpr D::D(T t) : C(t) {} // expected-error {{does not match any declaration in 'D'}}
33 // expected-note@#defined-here {{defined here}}