aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2017-09-05 13:33:44 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2017-09-05 13:33:44 +0000
commitd49318d9bc3e63251aada27b322e7756eab19884 (patch)
treec73edc1922313f044d57f416d20fd7978d7f8254 /gcc/cp/decl.c
parentae85ad3a95d6df3c4131d02fd327809a29d10b33 (diff)
downloadgcc-d49318d9bc3e63251aada27b322e7756eab19884.zip
gcc-d49318d9bc3e63251aada27b322e7756eab19884.tar.gz
gcc-d49318d9bc3e63251aada27b322e7756eab19884.tar.bz2
re PR c++/81942 (ICE on empty constexpr constructor with C++14)
/cp 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com> PR c++/81942 * cp-tree.h (LABEL_DECL_CDTOR): Add and document. * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when creating cdtor_label. * constexpr.c (returns): Add the case of a constructor/destructor returning via a LABEL_DECL_CDTOR label. (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise. /testsuite 2017-09-05 Paolo Carlini <paolo.carlini@oracle.com> PR c++/81942 * g++.dg/cpp1y/constexpr-return3.C: New. From-SVN: r251714
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d6b80c6..861dfcf 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -15072,7 +15072,10 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
if (DECL_DESTRUCTOR_P (decl1)
|| (DECL_CONSTRUCTOR_P (decl1)
&& targetm.cxx.cdtor_returns_this ()))
- cdtor_label = create_artificial_label (input_location);
+ {
+ cdtor_label = create_artificial_label (input_location);
+ LABEL_DECL_CDTOR (cdtor_label) = true;
+ }
start_fname_decls ();