public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ Patch] PR 65340
@ 2015-03-17 17:09 Paolo Carlini
  2015-03-18  0:11 ` Jason Merrill
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Carlini @ 2015-03-17 17:09 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

Hi,

this minor [5 Regression], an ICE on invalid, seems just matter of 
passing the tsubst_flags_t argument from build_over_call to mark_used 
and then guarding require_deduced_type in the latter. Tested x86_64-linux.

Thanks,
Paolo.

/////////////////////////

[-- Attachment #2: CL_65340 --]
[-- Type: text/plain, Size: 335 bytes --]

2015-03-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65340
	* call.c (build_over_call): Pass the tsubst_flags_t argument to
	mark_used.
	* decl2.c (mark_used): Guard the require_deduced_type call with
	complain & tf_error.

2015-03-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65340
	* g++.dg/cpp1y/pr65340.C: New.

[-- Attachment #3: patch_65340 --]
[-- Type: text/plain, Size: 1737 bytes --]

Index: cp/call.c
===================================================================
--- cp/call.c	(revision 221476)
+++ cp/call.c	(working copy)
@@ -7486,7 +7486,7 @@ build_over_call (struct z_candidate *cand, int fla
     }
 
   if (!already_used
-      && !mark_used (fn))
+      && !mark_used (fn, complain))
     return error_mark_node;
 
   if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0
Index: cp/decl2.c
===================================================================
--- cp/decl2.c	(revision 221476)
+++ cp/decl2.c	(working copy)
@@ -5037,7 +5037,8 @@ mark_used (tree decl, tsubst_flags_t complain)
       && uses_template_parms (DECL_TI_ARGS (decl)))
     return true;
 
-  require_deduced_type (decl);
+  if (complain & tf_error)
+    require_deduced_type (decl);
 
   /* If we don't need a value, then we don't need to synthesize DECL.  */
   if (cp_unevaluated_operand != 0)
Index: testsuite/g++.dg/cpp1y/pr65340.C
===================================================================
--- testsuite/g++.dg/cpp1y/pr65340.C	(revision 0)
+++ testsuite/g++.dg/cpp1y/pr65340.C	(working copy)
@@ -0,0 +1,19 @@
+// PR c++/65340
+// { dg-do compile { target c++14 } }
+
+template <typename Type> Type constant;
+namespace reflect {
+namespace functors {
+  struct recurse { auto operator()(, ); }; // { dg-error "expected" }
+}
+  auto &recurse = constant < functors :: recurse > ;
+}
+namespace functors {
+struct traverse {
+  template <typename Algo, typename Value>
+  auto operator()(Algo, Value) -> decltype(reflect
+                                           :: recurse(0, 0));
+};
+}
+auto &traverse = constant < functors :: traverse > ;
+operator()()->decltype(traverse(0, 0)) // { dg-error "use of|expected" }

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-16 14:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 17:09 [C++ Patch] PR 65340 Paolo Carlini
2015-03-18  0:11 ` Jason Merrill
2015-03-18  2:03   ` Paolo Carlini
2015-03-18  2:15     ` Jason Merrill
2015-04-15  1:31       ` Jason Merrill
2015-04-15  8:44         ` Paolo Carlini
2015-04-16 12:29         ` Paolo Carlini
2015-04-16 14:34           ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).