summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-11 21:30:18 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-11 21:30:18 +0000
commit1330e43958fb69797e839f46b918f4d5a36a10b3 (patch)
tree4fd40e140cf8b453b9b67a51b9e7b85ac05df507 /gcc/cp/class.c
parent88d773ec475960dbb2b381c941dce0342981287f (diff)
downloadgcc-1330e43958fb69797e839f46b918f4d5a36a10b3.tar.gz
PR c++/48948
* semantics.c (validate_constexpr_fundecl): Defer checking if an argument type is being defined. (is_valid_constexpr_fn): Add defer_ok parm. (cxx_eval_call_expression): Adjust. (check_deferred_constexpr_decls): New. (literal_type_p): Make sure type isn't being defined. (ensure_literal_type_for_constexpr_object): Handle type being defined. * cp-tree.h: Declare check_deferred_constexpr_decls. * decl.c (grokfndecl): Call validate_constexpr_fundecl here. (start_preparsed_function, cp_finish_decl): Not here. * class.c (finalize_literal_type_property): Don't call validate_constexpr_fundecl. (finish_struct): Call check_deferred_constexpr_decls. * pt.c (tsubst_decl): Call validate_constexpr_fundecl. (instantiate_class_template): Call check_deferred_constexpr_decls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 293dd1c0bd5..938d52201e3 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4578,8 +4578,6 @@ type_requires_array_cookie (tree type)
static void
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.
@@ -4589,11 +4587,6 @@ finalize_literal_type_property (tree t)
else if (CLASSTYPE_LITERAL_P (t) && !TYPE_HAS_TRIVIAL_DFLT (t)
&& !TYPE_HAS_CONSTEXPR_CTOR (t))
CLASSTYPE_LITERAL_P (t) = false;
-
- for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn))
- if (DECL_DECLARED_CONSTEXPR_P (fn)
- && TREE_CODE (fn) != TEMPLATE_DECL)
- validate_constexpr_fundecl (fn);
}
/* Check the validity of the bases and members declared in T. Add any
@@ -5834,6 +5827,8 @@ finish_struct (tree t, tree attributes)
else
error ("trying to finish struct, but kicked out due to previous parse errors");
+ check_deferred_constexpr_decls ();
+
if (processing_template_decl && at_function_scope_p ())
add_stmt (build_min (TAG_DEFN, t));