mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
2066ef6ac8
commit
a2923dbadb
|
|
@ -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>
|
2016-10-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
|
||||||
|
|
||||||
PR tree-optimization/53979
|
PR tree-optimization/53979
|
||||||
|
|
|
||||||
|
|
@ -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, "" );
|
||||||
Loading…
Reference in New Issue