From: Paolo Carlini Date: Sun, 2 Nov 2014 09:31:12 +0000 (+0000) Subject: re PR c++/57694 ([c++11] constexpr constructor does not work with const address of... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e82d71d91eeb2643799011866a011723755283c0;p=gcc.git re PR c++/57694 ([c++11] constexpr constructor does not work with const address of own member) 2014-11-02 Paolo Carlini PR c++/57694 * g++.dg/cpp0x/constexpr-ctor15.C: New. From-SVN: r217013 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 969a4f85edd..0cc71162665 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-02 Paolo Carlini + + PR c++/57694 + * g++.dg/cpp0x/constexpr-ctor15.C: New. + 2014-11-01 Edward Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp1y/feat-cxx11.C: Commentary and rearrangement of tests. diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor15.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor15.C new file mode 100644 index 00000000000..5ad278a6aa4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor15.C @@ -0,0 +1,29 @@ +// PR c++/57694 +// { dg-do compile { target c++11 } } + +class A +{ +private: + int a; + const int* const aptr; + +public: + constexpr A(int _a) : a(_a), aptr(&a) { } +}; + +class Data { } d1; + +class B +{ +private: + Data* dptr1; + +public: + constexpr B(Data* _p) : dptr1(_p) {} +}; + +class Use +{ + static constexpr A a{2}; + static constexpr B b{&d1}; +};