brintos

brintos / llvm-project-archived public Read only

0
0
Text · 841 B · dbc357c Raw
34 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -verify %s2//3// Note: [class.inhctor] was removed by P0136R1. This tests the new behavior4// for the wording that used to be there.5 6struct A {7  constexpr A(const int&) : rval(false) {}8  constexpr A(const int&&) : rval(true) {}9  bool rval;10};11struct B : A {12  using A::A;13};14 15constexpr int k = 0;16constexpr A a0{0};17constexpr A a1{k};18constexpr B b0{0};19constexpr B b1{k};20 21static_assert(a0.rval && !a1.rval && b0.rval && !b1.rval, "");22 23struct C {24  template<typename T> constexpr C(T t) : v(t) {}25  int v;26};27struct D : C { // #defined-here28  using C::C;29};30static_assert(D(123).v == 123, "");31 32template<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}}34