diff options
author | Jason Merrill <jason@redhat.com> | 2011-06-29 10:34:39 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-06-29 10:34:39 -0400 |
commit | b198484e89cb986f278461a0ee2229154c6654ee (patch) | |
tree | eddc02ef3cf46bce04652e8616df117283a29d25 /gcc/cp | |
parent | 1f2911476d723f30c53dd175589b2b561e36c439 (diff) | |
download | gcc-b198484e89cb986f278461a0ee2229154c6654ee.zip gcc-b198484e89cb986f278461a0ee2229154c6654ee.tar.gz gcc-b198484e89cb986f278461a0ee2229154c6654ee.tar.bz2 |
class.c (finalize_literal_type_property): Update conditions.
* class.c (finalize_literal_type_property): Update conditions.
* method.c (defaulted_late_check): Set TYPE_HAS_CONSTEXPR_CTOR.
From-SVN: r175644
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/class.c | 6 | ||||
-rw-r--r-- | gcc/cp/method.c | 12 |
3 files changed, 13 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e25f4e0..6177883 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-06-29 Jason Merrill <jason@redhat.com> + * class.c (finalize_literal_type_property): Update conditions. + * method.c (defaulted_late_check): Set TYPE_HAS_CONSTEXPR_CTOR. + * tree.c (build_vec_init_expr): Don't add TARGET_EXPR. * typeck2.c (digest_init_r): Handle VEC_INIT_EXPR. * semantics.c (cxx_eval_vec_init_1): Correct type. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 9e387a6..9054b5c 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4566,12 +4566,10 @@ finalize_literal_type_property (tree t) tree fn; if (cxx_dialect < cxx0x - || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) - /* FIXME These constraints seem unnecessary; remove from standard. - || !TYPE_HAS_TRIVIAL_COPY_CTOR (t) - || TYPE_HAS_COMPLEX_MOVE_CTOR (t)*/ ) + || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)) CLASSTYPE_LITERAL_P (t) = false; else if (CLASSTYPE_LITERAL_P (t) && !TYPE_HAS_TRIVIAL_DFLT (t) + && CLASSTYPE_NON_AGGREGATE (t) && !TYPE_HAS_CONSTEXPR_CTOR (t)) CLASSTYPE_LITERAL_P (t) = false; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 48b9c74..de43a38 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1571,10 +1571,14 @@ defaulted_late_check (tree fn) } TREE_TYPE (fn) = build_exception_variant (TREE_TYPE (fn), eh_spec); if (DECL_DECLARED_CONSTEXPR_P (implicit_fn)) - /* Hmm...should we do this for out-of-class too? Should it be OK to - add constexpr later like inline, rather than requiring - declarations to match? */ - DECL_DECLARED_CONSTEXPR_P (fn) = true; + { + /* Hmm...should we do this for out-of-class too? Should it be OK to + add constexpr later like inline, rather than requiring + declarations to match? */ + DECL_DECLARED_CONSTEXPR_P (fn) = true; + if (kind == sfk_constructor) + TYPE_HAS_CONSTEXPR_CTOR (ctx) = true; + } } if (!DECL_DECLARED_CONSTEXPR_P (implicit_fn) |