public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26740]  New: [4.2 regression] ICE taking the address of a bound member function
@ 2006-03-18  2:42 reichelt at gcc dot gnu dot org
  2006-03-18  3:05 ` [Bug c++/26740] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-03-18  2:42 UTC (permalink / raw)
  To: gcc-bugs

The following testcases cause ICEs on mainline:

g++.old-deja/g++.bugs/900213_03.C
g++.old-deja/g++.other/pmf2.C
g++.old-deja/g++.other/pmf7.C

They all crash at the same position:

pmf2.C: In function 'void f()':
pmf2.C:17: error: ISO C++ forbids taking the address of a bound member function
to form a pointer to member function.  Say '&S::f'
pmf2.C:17: internal compiler error: in build_offset_ref, at cp/init.c:1353
Please submit a full bug report, [etc.]


-- 
           Summary: [4.2 regression] ICE taking the address of a bound
                    member function
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
@ 2006-03-18  3:05 ` pinskia at gcc dot gnu dot org
  2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-18  3:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
  2006-03-18  3:05 ` [Bug c++/26740] " pinskia at gcc dot gnu dot org
  2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
@ 2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
  2006-03-24 17:08 ` reichelt at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-18  3:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-18 03:08 -------
Grrr.  Well confirmed.  The reason why this does show up in the testresults is
because of the follow:
  fmp = &ptr->function_member;  // { dg-error "" }
        pmf = & pf->f; // { dg-error "" } not a valid pmf expression
  &a.f;                         // { dg-error "" } overloaded

Meaning dg-error should really take an argument instead of just a null string.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-18 03:08:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
  2006-03-18  3:05 ` [Bug c++/26740] " pinskia at gcc dot gnu dot org
@ 2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
  2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-18  3:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-18 03:09 -------
So who ever fixes this bug, please also fix the testsuite so the testsuite will
show the ICE.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
@ 2006-03-24 17:08 ` reichelt at gcc dot gnu dot org
  2006-04-24  1:51 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-03-24 17:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2006-03-24 17:08 -------
The following code should compile with -fpermissive or -fms-extensions.
So changing to ice-on-valid-code.

======================================
struct A
{
    void foo();
};

void bar()
{
    &A().foo;
}
======================================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|error-recovery, ice-on-     |ice-on-valid-code, monitored
                   |invalid-code                |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-03-24 17:08 ` reichelt at gcc dot gnu dot org
@ 2006-04-24  1:51 ` pinskia at gcc dot gnu dot org
  2006-05-08  7:54 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-24  1:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-04-24 01:51 -------
This patch fixes the ICE for me but I don't know if it is the correct one:
Index: cp/typeck.c
===================================================================
--- cp/typeck.c (revision 113199)
+++ cp/typeck.c (working copy)
@@ -4208,6 +4208,7 @@ build_unary_op (enum tree_code code, tre
             and the created OFFSET_REF.  */
          tree base = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg, 0)));
          tree fn = get_first_fn (TREE_OPERAND (arg, 1));
+         mark_used (fn);

          if (! flag_ms_extensions)
            {


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-04-24  1:51 ` pinskia at gcc dot gnu dot org
@ 2006-05-08  7:54 ` pinskia at gcc dot gnu dot org
  2006-05-20 23:14 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-08  7:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-05-08 07:54 -------
Mine.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-05-08  7:54 ` pinskia at gcc dot gnu dot org
@ 2006-05-20 23:14 ` patchapp at dberlin dot org
  2006-06-04 17:41 ` pinskia at gcc dot gnu dot org
  2006-06-04 17:43 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: patchapp at dberlin dot org @ 2006-05-20 23:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from patchapp at dberlin dot org  2006-05-20 23:14 -------
Subject: Bug number PR C++/26740

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01042.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-05-20 23:14 ` patchapp at dberlin dot org
@ 2006-06-04 17:41 ` pinskia at gcc dot gnu dot org
  2006-06-04 17:43 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-04 17:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-06-04 17:41 -------
Subject: Bug 26740

Author: pinskia
Date: Sun Jun  4 17:40:51 2006
New Revision: 114360

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114360
Log:
2006-06-01  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/26740
        * typeck.c (build_unary_op): Mark the function as being used.


Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

* [Bug c++/26740] [4.2 regression] ICE taking the address of a bound member function
  2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-06-04 17:41 ` pinskia at gcc dot gnu dot org
@ 2006-06-04 17:43 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-04 17:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-06-04 17:41 -------
Subject: Bug 26740

Author: pinskia
Date: Sun Jun  4 17:40:51 2006
New Revision: 114360

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114360
Log:
2006-06-01  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/26740
        * typeck.c (build_unary_op): Mark the function as being used.


Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c


------- Comment #8 from pinskia at gcc dot gnu dot org  2006-06-04 17:41 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26740


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

end of thread, other threads:[~2006-06-04 17:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-18  2:42 [Bug c++/26740] New: [4.2 regression] ICE taking the address of a bound member function reichelt at gcc dot gnu dot org
2006-03-18  3:05 ` [Bug c++/26740] " pinskia at gcc dot gnu dot org
2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
2006-03-18  3:09 ` pinskia at gcc dot gnu dot org
2006-03-24 17:08 ` reichelt at gcc dot gnu dot org
2006-04-24  1:51 ` pinskia at gcc dot gnu dot org
2006-05-08  7:54 ` pinskia at gcc dot gnu dot org
2006-05-20 23:14 ` patchapp at dberlin dot org
2006-06-04 17:41 ` pinskia at gcc dot gnu dot org
2006-06-04 17:43 ` pinskia at gcc dot gnu dot org

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).