]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/58610 ([c++11] ICE with constexpr of class with template constructor)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 28 Feb 2014 20:20:21 +0000 (20:20 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 28 Feb 2014 20:20:21 +0000 (20:20 +0000)
/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

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/lambda.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-ice11.C [new file with mode: 0644]

index eaec5222775ecba9ff3630a3fca05734bf9d8dd9..9a13f49ef13f5aa65bd251b61cb00666de2bf1f7 100644 (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
index 53b97d9db947747fce72a47abb01d068f102a623..b58c072dfbc55d1d6cdf7642e79def2f41c579e7 100644 (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);
index 3db18f3eaecd4914f99be94d649614f58225988c..8ec7d6aea1d90626c3f2a1b6f66a09c357892ab9 100644 (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) \
index 277dec6d2b9d53c6514c7a300cde756955f0124a..0b8b46a8144d127a8eae89f53333d09033f6ffe3 100644 (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;
     }
 
index c8a7fb4f094e0843d74660dad2f88a354747386b..3011092bc2ebcfa85135a6898d758044cc4b5777 100644 (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
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice11.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice11.C
new file mode 100644 (file)
index 0000000..3e32bf6
--- /dev/null
@@ -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" }