public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32232]  New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification
@ 2007-06-06 10:33 jakub at gcc dot gnu dot org
  2007-06-06 12:55 ` [Bug c++/32232] " rguenth at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-06 10:33 UTC (permalink / raw)
  To: gcc-bugs

// { dg-do compile }

template<typename T> struct A;
template<typename T> struct B {};
template<typename T> A<T>& operator<<(A<T>&, const B<T>&);

template<typename T>
struct A
{
  A<T>& operator<<(A<T>& (*)(A<T>&));
};

template<typename T> A<T>& foo(A<T>&);
extern A<char> c;

int
main()
{
  c << (1, foo);
}

ICEs in resolve_overloaded_unification with 3.4, 4.1.2 and the trunk, compiles
fine with 3.2.3.


-- 
           Summary: [4.1/4.2/4.3 Regression] ICE in
                    resolve_overloaded_unification
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


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

* [Bug c++/32232] [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
@ 2007-06-06 12:55 ` rguenth at gcc dot gnu dot org
  2007-06-29 18:40 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-06-06 12:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-06-06 12:55 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |3.4.0 4.1.2 4.2.0 4.3.0
      Known to work|                            |3.3.6
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-06 12:55:38
               date|                            |
   Target Milestone|---                         |4.1.3


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


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

* [Bug c++/32232] [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
  2007-06-06 12:55 ` [Bug c++/32232] " rguenth at gcc dot gnu dot org
@ 2007-06-29 18:40 ` mmitchel at gcc dot gnu dot org
  2007-07-06  2:56 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-29 18:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/32232] [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
  2007-06-06 12:55 ` [Bug c++/32232] " rguenth at gcc dot gnu dot org
  2007-06-29 18:40 ` mmitchel at gcc dot gnu dot org
@ 2007-07-06  2:56 ` mmitchel at gcc dot gnu dot org
  2007-07-07  7:32 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-06  2:56 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mmitchel at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-06-06 12:55:38         |2007-07-06 02:56:28
               date|                            |


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


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

* [Bug c++/32232] [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-06  2:56 ` mmitchel at gcc dot gnu dot org
@ 2007-07-07  7:32 ` mmitchel at gcc dot gnu dot org
  2007-07-07  7:36 ` [Bug c++/32232] [4.1/4.2 " mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-07  7:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2007-07-07 07:32 -------
Subject: Bug 32232

Author: mmitchel
Date: Sat Jul  7 07:31:54 2007
New Revision: 126435

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126435
Log:
        PR c++/32232
        * pt.c (resolve_overloaded_unification): Robustify.  Return a
        bool, not an int.
        (type_unification_real): Adjust accordingly.
        PR c++/32232
        * g++.dg/template/overload9.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/overload9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/32232] [4.1/4.2 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-07-07  7:32 ` mmitchel at gcc dot gnu dot org
@ 2007-07-07  7:36 ` mmitchel at gcc dot gnu dot org
  2007-07-07 19:16 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-07  7:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2007-07-07 07:36 -------
Fixed in 4.3.0.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3 Regression] ICE|[4.1/4.2 Regression] ICE in
                   |in                          |resolve_overloaded_unificati
                   |resolve_overloaded_unificati|on
                   |on                          |


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


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

* [Bug c++/32232] [4.1/4.2 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-07-07  7:36 ` [Bug c++/32232] [4.1/4.2 " mmitchel at gcc dot gnu dot org
@ 2007-07-07 19:16 ` mmitchel at gcc dot gnu dot org
  2007-07-07 19:16 ` [Bug c++/32232] [4.1 " mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-07 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2007-07-07 19:16 -------
Subject: Bug 32232

Author: mmitchel
Date: Sat Jul  7 19:16:09 2007
New Revision: 126443

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126443
Log:
        PR c++/32232
        * pt.c (resolve_overloaded_unification): Robustify.  Return a
        bool, not an int.
        (type_unification_real): Adjust accordingly.
        PR c++/32232
        * g++.dg/template/overload9.C: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/overload9.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/pt.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/32232] [4.1 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-07-07 19:16 ` mmitchel at gcc dot gnu dot org
@ 2007-07-07 19:16 ` mmitchel at gcc dot gnu dot org
  2007-07-11 23:04 ` reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-07 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2007-07-07 19:16 -------
Fixed in 4.2.1.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|mmitchel at gcc dot gnu dot |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW
            Summary|[4.1/4.2 Regression] ICE in |[4.1 Regression] ICE in
                   |resolve_overloaded_unificati|resolve_overloaded_unificati
                   |on                          |on


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


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

* [Bug c++/32232] [4.1 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-07-07 19:16 ` [Bug c++/32232] [4.1 " mmitchel at gcc dot gnu dot org
@ 2007-07-11 23:04 ` reichelt at gcc dot gnu dot org
  2007-07-12  6:20 ` mark at codesourcery dot com
  2008-07-04 16:08 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-07-11 23:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from reichelt at gcc dot gnu dot org  2007-07-11 23:04 -------
Mark, I don't think the fix for this PR is complete, because the following
simplified testcase (which previously ICE'd) should compile IMHO:

=============================================================
template<typename> struct A
{
  A& operator<<(void (*)(A&));
};

template<typename T> A<T>& operator<<(A<T>&, const A<T>&);

template<typename T> void foo(A<T>&);

void bar()
{
  A<int>() << (1, foo<int>);
}
=============================================================

But it is rejected with the following error message:

bug.cc: In function 'void bar()':
bug.cc:12: error: no match for 'operator<<' in 'A<int>() << (0, foo<int>)'
bug.cc:3: note: candidates are: A< <template-parameter-1-1> >& A<
<template-parameter-1-1> >::operator<<(void (*)(A< <template-parameter-1-1>
>&)) [with <template-parameter-1-1> = int]

An even smaller testcase for this problem is the following:

=============================================================
struct A
{
  A& operator<<(void (*)(A&));
};

template<typename> void foo(A&);

void bar()
{
  A() << (1, foo<int>);
}
=============================================================

bug.cc: In function 'void bar()':
bug.cc:10: error: no match for 'operator<<' in 'A() << (0, foo<int>)'
bug.cc:3: note: candidates are: A& A::operator<<(void (*)(A&))

The code compiles fine, if I remove the "0,".

Btw, there's another glitch in the error message:
The code contains "(1, foo<int>)", which is printed as "(0, foo<int>)"
in the error message.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at codesourcery dot com


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


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

* [Bug c++/32232] [4.1 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-07-11 23:04 ` reichelt at gcc dot gnu dot org
@ 2007-07-12  6:20 ` mark at codesourcery dot com
  2008-07-04 16:08 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mark at codesourcery dot com @ 2007-07-12  6:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mark at codesourcery dot com  2007-07-12 06:20 -------
Subject: Re:  [4.1 Regression] ICE in resolve_overloaded_unification

reichelt at gcc dot gnu dot org wrote:
> template<typename> struct A
> {
>   A& operator<<(void (*)(A&));
> };
> 
> template<typename T> A<T>& operator<<(A<T>&, const A<T>&);
> 
> template<typename T> void foo(A<T>&);
> 
> void bar()
> {
>   A<int>() << (1, foo<int>);
> }

As I (thought I?  meant to?) said in the patch submission mail, I don't
think this is valid.  The syntactic form of the expression matters for
deduction purposes, and my reading of the standard is that only a
(generalized) identifier is allowed.  (It's not very clear, but I didn't
see anything to suggest that your code was valid.)  The version of the
EDG front end I had on hand agreed with me. :-)  You could certainly ask
on the core reflector, etc.

The issue about printing "(0, ...)" instead of "(1, ...)" is certainly a
bug, but a different one from this.


-- 


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


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

* [Bug c++/32232] [4.1 Regression] ICE in resolve_overloaded_unification
  2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-07-12  6:20 ` mark at codesourcery dot com
@ 2008-07-04 16:08 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jsm28 at gcc dot gnu dot org  2008-07-04 16:07 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|3.4.0 4.1.2                 |3.4.0 4.1.2 4.1.3
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.1


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


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

end of thread, other threads:[~2008-07-04 16:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-06 10:33 [Bug c++/32232] New: [4.1/4.2/4.3 Regression] ICE in resolve_overloaded_unification jakub at gcc dot gnu dot org
2007-06-06 12:55 ` [Bug c++/32232] " rguenth at gcc dot gnu dot org
2007-06-29 18:40 ` mmitchel at gcc dot gnu dot org
2007-07-06  2:56 ` mmitchel at gcc dot gnu dot org
2007-07-07  7:32 ` mmitchel at gcc dot gnu dot org
2007-07-07  7:36 ` [Bug c++/32232] [4.1/4.2 " mmitchel at gcc dot gnu dot org
2007-07-07 19:16 ` mmitchel at gcc dot gnu dot org
2007-07-07 19:16 ` [Bug c++/32232] [4.1 " mmitchel at gcc dot gnu dot org
2007-07-11 23:04 ` reichelt at gcc dot gnu dot org
2007-07-12  6:20 ` mark at codesourcery dot com
2008-07-04 16:08 ` jsm28 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).