re PR c++/58610 ([c++11] ICE with constexpr of class with template constructor)

/cp
2014-02-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58610
	* cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
	* call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
	* lambda.c (maybe_add_lambda_conv_op): Likewise.

/testsuite
2014-02-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58610
	* g++.dg/cpp0x/constexpr-ice11.C: New.

From-SVN: r208226
This commit is contained in:
Paolo Carlini 2014-02-28 20:20:21 +00:00 committed by Paolo Carlini
parent c5b001b5f0
commit f1ee5eaf07
6 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58610
* cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
* call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
* lambda.c (maybe_add_lambda_conv_op): Likewise.
2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60253

View File

@ -3237,7 +3237,7 @@ print_z_candidate (location_t loc, const char *msgstr,
inform (cloc, "%s%T <conversion>", msg, candidate->fn);
else if (candidate->viable == -1)
inform (cloc, "%s%#D <near match>", msg, candidate->fn);
else if (DECL_DELETED_FN (STRIP_TEMPLATE (candidate->fn)))
else if (DECL_DELETED_FN (candidate->fn))
inform (cloc, "%s%#D <deleted>", msg, candidate->fn);
else
inform (cloc, "%s%#D", msg, candidate->fn);

View File

@ -3222,7 +3222,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
/* Nonzero if DECL was declared with '= delete'. */
#define DECL_DELETED_FN(DECL) \
(DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->u.base.threadprivate_or_deleted_p)
(LANG_DECL_FN_CHECK (DECL)->min.base.threadprivate_or_deleted_p)
/* Nonzero if DECL was declared with '= default' (maybe implicitly). */
#define DECL_DEFAULTED_FN(DECL) \

View File

@ -975,7 +975,7 @@ maybe_add_lambda_conv_op (tree type)
the conversion op is used. */
if (varargs_function_p (callop))
{
DECL_DELETED_FN (STRIP_TEMPLATE (fn)) = 1;
DECL_DELETED_FN (fn) = 1;
return;
}

View File

@ -1,3 +1,8 @@
2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58610
* g++.dg/cpp0x/constexpr-ice11.C: New.
2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60314

View File

@ -0,0 +1,9 @@
// PR c++/58610
// { dg-do compile { target c++11 } }
struct A
{
template<typename> A();
};
constexpr A a; // { dg-error "literal|matching" }