public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-04  0:55 ` jason at gcc dot gnu.org
  2011-03-04 22:24 ` jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-04  0:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |ice-on-valid-code
                 CC|                            |jason at gcc dot gnu.org
      Known to fail|                            |

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-04 00:54:56 UTC ---
Same ICE on valid testcase:

template<typename T> int cmp1(T a, T b);
template<typename T> int cmp2(T a, T b);
template<typename T, int (*cmp)(T, T) = cmp1> struct A { };
template <typename T> void f (A<T> &);
void g()
{
  A<char> a;
  f(a);
}

though 3.4 didn't accept it, it gave the same sorry, so it isn't a big
regression.


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
  2011-03-04  0:55 ` [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155 jason at gcc dot gnu.org
@ 2011-03-04 22:24 ` jason at gcc dot gnu.org
  2011-03-04 22:30 ` jason at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-04 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-04 22:24:30 UTC ---
Created attachment 23550
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23550
WIP patch to accept my testcase

Here's a patch that makes my testcase work.  I don't want to put it in 4.6
because it produces mangling different from the EDG compiler, and want to
clarify how it should mangle first.


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
  2011-03-04  0:55 ` [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155 jason at gcc dot gnu.org
  2011-03-04 22:24 ` jason at gcc dot gnu.org
@ 2011-03-04 22:30 ` jason at gcc dot gnu.org
  2011-03-09 17:53 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-04 22:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-04 22:30:16 UTC ---
Created attachment 23551
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23551
WIP patch to make the testcase sorry as before

And here's a patch that just restores the previous sorry behavior.  Do you
think it's worth applying this to 4.6?


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-03-04 22:30 ` jason at gcc dot gnu.org
@ 2011-03-09 17:53 ` jason at gcc dot gnu.org
  2011-03-09 17:58 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-09 17:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ABI
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-09 17:52:53 UTC ---
A middle ground would be to fix the bug in unify without adding mangling
support, so we get the sorry there.  I guess I'll do that.


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-03-09 17:58 ` jason at gcc dot gnu.org
@ 2011-03-09 17:58 ` jason at gcc dot gnu.org
  2011-03-09 18:01 ` [Bug c++/44629] [4.3 " jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-09 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-09 17:57:50 UTC ---
Author: jason
Date: Wed Mar  9 17:57:46 2011
New Revision: 170824

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170824
Log:
    PR c++/44629
    * pt.c (unify): An unresolved overload is a nondeduced context.

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


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-03-09 17:53 ` jason at gcc dot gnu.org
@ 2011-03-09 17:58 ` jason at gcc dot gnu.org
  2011-03-09 17:58 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-09 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-09 17:57:54 UTC ---
Author: jason
Date: Wed Mar  9 17:57:51 2011
New Revision: 170826

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170826
Log:
    PR c++/44629
    * pt.c (unify): An unresolved overload is a nondeduced context.

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


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

* [Bug c++/44629] [4.3 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-03-09 17:58 ` jason at gcc dot gnu.org
@ 2011-03-09 18:01 ` jason at gcc dot gnu.org
  2011-03-09 21:53 ` bangerth at gmail dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-09 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.3.6                       |4.4.6
            Summary|[4.3/4.4/4.5/4.6            |[4.3 Regression] ICE in
                   |Regression] ICE in unify,   |unify, at cp/pt.c:15155
                   |at cp/pt.c:15155            |

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-09 18:01:02 UTC ---
ICE fixed in 4.4, 4.5, 4.6.  Not worth applying to 4.3 at this point I think.


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

* [Bug c++/44629] [4.3 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-03-09 18:01 ` [Bug c++/44629] [4.3 " jason at gcc dot gnu.org
@ 2011-03-09 21:53 ` bangerth at gmail dot com
  2011-03-10  2:48 ` jason at gcc dot gnu.org
  2011-03-10  4:28 ` bangerth at gmail dot com
  9 siblings, 0 replies; 12+ messages in thread
From: bangerth at gmail dot com @ 2011-03-09 21:53 UTC (permalink / raw)
  To: gcc-bugs

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

Wolfgang Bangerth <bangerth at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com

--- Comment #12 from Wolfgang Bangerth <bangerth at gmail dot com> 2011-03-09 21:52:52 UTC ---
(In reply to comment #4)
> template<typename T> int cmp1(T a, T b);
> template<typename T> int cmp2(T a, T b);
> template<typename T, int (*cmp)(T, T) = cmp1> struct A { };

I'm confused why this would be an overload set. cmp1 is a template so I
can't see how this code would even begin to be valid without specifying
the template argument in the default argument...

W.


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

* [Bug c++/44629] [4.3 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2011-03-09 21:53 ` bangerth at gmail dot com
@ 2011-03-10  2:48 ` jason at gcc dot gnu.org
  2011-03-10  4:28 ` bangerth at gmail dot com
  9 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-10  2:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-10 02:48:48 UTC ---
(In reply to comment #12)
> I'm confused why this would be an overload set. cmp1 is a template so I
> can't see how this code would even begin to be valid without specifying
> the template argument in the default argument...

Once you know A's T, you have a desired type int (*)(T, T) from which to
determine which specialization of the template to use.


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

* [Bug c++/44629] [4.3 Regression] ICE in unify, at cp/pt.c:15155
       [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2011-03-10  2:48 ` jason at gcc dot gnu.org
@ 2011-03-10  4:28 ` bangerth at gmail dot com
  9 siblings, 0 replies; 12+ messages in thread
From: bangerth at gmail dot com @ 2011-03-10  4:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Wolfgang Bangerth <bangerth at gmail dot com> 2011-03-10 04:27:49 UTC ---
(In reply to comment #13)
> Once you know A's T, you have a desired type int (*)(T, T) from which to
> determine which specialization of the template to use.

Hm, I agree that the type could be deduced. I could nevertheless
have sworn that this should be invalid:
..........................
template <typename T> int cmp1(T a, T b);
int (*cmp)(int, int) = cmp1;
...........................
But it compiles in fact.

I had no idea a template name could be implicitly instantiated in this
context. Thanks for educating me!

Best
 W.


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
  2010-06-22  9:57 [Bug c++/44629] New: " doko at ubuntu dot com
  2010-06-22 16:46 ` [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] " jakub at gcc dot gnu dot org
@ 2010-06-24 21:59 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-24 21:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155
  2010-06-22  9:57 [Bug c++/44629] New: " doko at ubuntu dot com
@ 2010-06-22 16:46 ` jakub at gcc dot gnu dot org
  2010-06-24 21:59 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-22 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-06-22 16:46 -------
3.4 gives here:
pr44629.C:23: sorry, unimplemented: use of `overload' in template type
unification
pr44629.C:23: error: no matching function for call to
`Grapher::simple_output(Searcher<char, unsafe_case_cmp [with T = char]>&)'
 int unsafe_case_cmp(T, T) [with T = char]

So it is a regression.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE in unify, at            |[4.3/4.4/4.5/4.6 Regression]
                   |cp/pt.c:15155               |ICE in unify, at
                   |                            |cp/pt.c:15155
   Target Milestone|---                         |4.3.6


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


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

end of thread, other threads:[~2011-03-10  4:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44629-4@http.gcc.gnu.org/bugzilla/>
2011-03-04  0:55 ` [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] ICE in unify, at cp/pt.c:15155 jason at gcc dot gnu.org
2011-03-04 22:24 ` jason at gcc dot gnu.org
2011-03-04 22:30 ` jason at gcc dot gnu.org
2011-03-09 17:53 ` jason at gcc dot gnu.org
2011-03-09 17:58 ` jason at gcc dot gnu.org
2011-03-09 17:58 ` jason at gcc dot gnu.org
2011-03-09 18:01 ` [Bug c++/44629] [4.3 " jason at gcc dot gnu.org
2011-03-09 21:53 ` bangerth at gmail dot com
2011-03-10  2:48 ` jason at gcc dot gnu.org
2011-03-10  4:28 ` bangerth at gmail dot com
2010-06-22  9:57 [Bug c++/44629] New: " doko at ubuntu dot com
2010-06-22 16:46 ` [Bug c++/44629] [4.3/4.4/4.5/4.6 Regression] " jakub at gcc dot gnu dot org
2010-06-24 21:59 ` rguenth 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).