Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-97740b.C

raw
1 // PR c++/97740
2 // { dg-do compile { target c++14 } }
3
4 struct A {
5 constexpr const int* get() const { return &m; }
6 private:
7 int m;
8 } a;
9
10 struct B { const int* p; };
11
12 template<A* arg>
13 void f() {
14 [] (auto) {
15 constexpr B x = {arg->get()}; // { dg-bogus "private" }
16 constexpr B y = {&arg->m}; // { dg-error "private" }
17 }(0);
18 }
19
20 template void f<&a>();