re PR c++/48948 ([C++0x] constexpr friend function cannot be defined in-class)
authorJason Merrill <jason@redhat.com>
Wed, 11 May 2011 21:30:18 +0000 (17:30 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 11 May 2011 21:30:18 +0000 (17:30 -0400)
commit6eb47b98291138b27e13cc8da738cd3d08ea80a0
tree4fd40e140cf8b453b9b67a51b9e7b85ac05df507
parent3c5283a738132562b7711278a09d3bd09239b7be
re PR c++/48948 ([C++0x] constexpr friend function cannot be defined in-class)

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.

From-SVN: r173683
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-friend.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete1.C [new file with mode: 0644]