PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
authorMarek Polacek <polacek@redhat.com>
Wed, 28 Aug 2019 02:03:48 +0000 (02:03 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 28 Aug 2019 02:03:48 +0000 (02:03 +0000)
commit14da3939da3adcef84816573caa9d93c7367507e
tree1bc500d3505ce6feb8743a102df9a66cbb3bf3d4
parent4719ac2f2d1d770a840316d02e68fdff8e223129
PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.

* cp-tree.h (decl_in_std_namespace_p): Declare.
* semantics.c (is_std_constant_evaluated_p): New.
(finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
an if-constexpr.
* typeck.c (decl_in_std_namespace_p): No longer static.

* g++.dg/cpp2a/is-constant-evaluated9.C: New test.

From-SVN: r274981
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated9.C [new file with mode: 0644]