public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Carlini <paolo.carlini@oracle.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Jason Merrill <jason@redhat.com>
Subject: [C++ Patch] PR 44625
Date: Mon, 05 Jul 2010 11:52:00 -0000	[thread overview]
Message-ID: <4C31C773.3050000@oracle.com> (raw)

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

Hi,

I have this patchlet for another case where we use BASELINK_P on
NULL_TREE. Tested x86_64-linux. I propose to apply it to mainline and
4_5-branch only and then close the PR: it's a regression, but just a P5
ice-on-invalid.

Thanks,
Paolo.

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

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

/cp
2010-07-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/44625
	* pt.c (tsubst_copy_and_build): Do not apply BASELINK_P on
	NULL_TREE.

/testsuite
2010-07-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/44625
	* g++.dg/template/crash102.C: New.

[-- Attachment #3: patch_44625 --]
[-- Type: text/plain, Size: 1558 bytes --]

Index: testsuite/g++.dg/template/crash102.C
===================================================================
--- testsuite/g++.dg/template/crash102.C	(revision 0)
+++ testsuite/g++.dg/template/crash102.C	(revision 0)
@@ -0,0 +1,19 @@
+// PR c++/44625
+// { dg-do compile }
+// { dg-options "" }
+
+template<typename FP_> struct Vec { // { dg-message "note" }
+    Vec& operator^=(Vec& rhs)     {
+        union {
+            struct {FP_ x,y,z;};
+        }; // { dg-error "anonymous struct" }
+        y*rhs.z() - z*rhs.y(); // { dg-error "no member" }
+	return *this;
+    }
+    Vec& operator^(Vec& rhs) {
+        return Vec(*this)^=rhs; // { dg-message "instantiated" }
+    }
+};
+Vec<double> v(3,4,12);  // { dg-error "no matching" }
+Vec<double> V(12,4,3);  // { dg-error "no matching" }
+Vec<double> c = v^V;    // { dg-message "instantiated" }
Index: cp/pt.c
===================================================================
--- cp/pt.c	(revision 161825)
+++ cp/pt.c	(working copy)
@@ -12625,7 +12625,9 @@ tsubst_copy_and_build (tree t,
       {
 	tree object;
 	tree object_type;
-	tree member;
+	tree member = TREE_OPERAND (t, 1);
+	if (!member)
+	  return error_mark_node;
 
 	object = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
 						     args, complain, in_decl);
@@ -12634,7 +12636,6 @@ tsubst_copy_and_build (tree t,
 	  mark_used (object);
 	object_type = TREE_TYPE (object);
 
-	member = TREE_OPERAND (t, 1);
 	if (BASELINK_P (member))
 	  member = tsubst_baselink (member,
 				    non_reference (TREE_TYPE (object)),

             reply	other threads:[~2010-07-05 11:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-05 11:52 Paolo Carlini [this message]
2010-07-05 13:10 ` Jason Merrill
2010-07-05 13:13   ` Paolo Carlini
2010-07-05 20:47     ` [C++ Patch] PR 44625, v2 Paolo Carlini
2010-08-17 15:49       ` Jason Merrill
2011-06-23 11:56 [C++ Patch] PR 44625 Paolo Carlini
2011-06-23 15:17 ` Jason Merrill
2011-06-23 15:47   ` Paolo Carlini
2011-06-23 16:01     ` Jason Merrill
2011-06-23 16:06       ` Paolo Carlini
2011-06-23 16:06         ` Jason Merrill
2011-06-23 16:06           ` Jason Merrill
2011-06-23 16:13             ` Paolo Carlini
2011-06-23 16:19               ` Paolo Carlini
2011-06-23 16:53             ` Paolo Carlini
2011-06-23 16:54               ` Jason Merrill
2011-06-23 16:11           ` Paolo Carlini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C31C773.3050000@oracle.com \
    --to=paolo.carlini@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).