diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2016-10-20 08:15:49 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2016-10-20 08:15:49 +0000 |
commit | a2923dbadb6c42594763db5cf11ee4f954ae8347 (patch) | |
tree | a2ebeb72862c9fe765a2f54d3a8ad50bb31c893d /gcc | |
parent | 2066ef6ac8cd3e04f46b9fceeb7b8d16eff62cf3 (diff) | |
download | gcc-a2923dbadb6c42594763db5cf11ee4f954ae8347.zip gcc-a2923dbadb6c42594763db5cf11ee4f954ae8347.tar.gz gcc-a2923dbadb6c42594763db5cf11ee4f954ae8347.tar.bz2 |
re PR c++/77446 (Suspicious "non-constant condition for static assertion" error)
2016-10-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/77446
* g++.dg/cpp1y/pr77446.C: New.
From-SVN: r241361
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/pr77446.C | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 152b1b2..b161d5c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-10-20 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/77446 + * g++.dg/cpp1y/pr77446.C: New. + 2016-10-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> PR tree-optimization/53979 diff --git a/gcc/testsuite/g++.dg/cpp1y/pr77446.C b/gcc/testsuite/g++.dg/cpp1y/pr77446.C new file mode 100644 index 0000000..f7c6eaf --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr77446.C @@ -0,0 +1,23 @@ +// PR c++/77446 +// { dg-do compile { target c++14 } } + +struct inner { + int field_a = 0; + bool field_b = false; + + explicit constexpr inner(const int &arg_field_a) noexcept + : field_a{ arg_field_a } {} +}; + +struct outer { + inner the_inner = inner{ 0 }; + + constexpr outer() noexcept = default; + constexpr int set_inner(const inner &arg_inner) { + the_inner = arg_inner; + return 0; + } +}; + +constexpr inner another_inner{ 1 }; +static_assert( outer{}.set_inner( another_inner ) == 0, "" ); |