diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-11-05 11:16:39 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-11-05 11:16:39 +0100 |
commit | 81012684569cfb64b0274f117d68740cde52ffdd (patch) | |
tree | 922cd8129f527b702c8f2c150cf2f0a5f933a67e /gcc/cp/constexpr.c | |
parent | 8f119c559e7f56eb3deac726b32f70e2befaf58d (diff) | |
download | gcc-81012684569cfb64b0274f117d68740cde52ffdd.zip gcc-81012684569cfb64b0274f117d68740cde52ffdd.tar.gz gcc-81012684569cfb64b0274f117d68740cde52ffdd.tar.bz2 |
re PR c++/92343 ([[likely]]/[[unlikely]] prevent method from being a constant expression)
PR c++/92343
* constexpr.c (potential_constant_expression_1): Return true rather
than false for PREDICT_EXPR.
* g++.dg/cpp2a/attr-likely6.C: New test.
From-SVN: r277819
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 84ed7ac..72de2ef 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -6493,6 +6493,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, case LABEL_DECL: case LABEL_EXPR: case CASE_LABEL_EXPR: + case PREDICT_EXPR: case CONST_DECL: case SIZEOF_EXPR: case ALIGNOF_EXPR: @@ -7354,7 +7355,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, return true; case EMPTY_CLASS_EXPR: - case PREDICT_EXPR: return false; case GOTO_EXPR: |