public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20173] New: Wrong template function specialization chosen
@ 2005-02-23 20:38 sstrasser at systemhaus-gruppe dot de
  2005-02-23 20:41 ` [Bug c++/20173] " sstrasser at systemhaus-gruppe dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-02-23 20:38 UTC (permalink / raw)
  To: gcc-bugs

attaching testcase.

result should be '1', but is '2', an int is matched to a pointer.
(and the pointer has the value of the integer in the function)

is known to fail for 3.3.5 and 3.4.4.
I can't test with 4.0 atm but I think it also fails because I came across this
by a strange internal tree generated by 4.0.

-- 
           Summary: Wrong template function specialization chosen
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sstrasser at systemhaus-gruppe dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/20173] Wrong template function specialization chosen
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
@ 2005-02-23 20:41 ` sstrasser at systemhaus-gruppe dot de
  2005-02-23 20:43 ` sstrasser at systemhaus-gruppe dot de
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-02-23 20:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sstrasser at systemhaus-gruppe dot de  2005-02-23 17:16 -------
Created an attachment (id=8266)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8266&action=view)
testcase


-- 


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


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

* [Bug c++/20173] Wrong template function specialization chosen
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
  2005-02-23 20:41 ` [Bug c++/20173] " sstrasser at systemhaus-gruppe dot de
@ 2005-02-23 20:43 ` sstrasser at systemhaus-gruppe dot de
  2005-02-23 20:44 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-02-23 20:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sstrasser at systemhaus-gruppe dot de  2005-02-23 17:19 -------
Comeau C++ thinks this code is invalid.
If it's right, this bug might be related to #20157

-- 


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


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

* [Bug c++/20173] Wrong template function specialization chosen
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
  2005-02-23 20:41 ` [Bug c++/20173] " sstrasser at systemhaus-gruppe dot de
  2005-02-23 20:43 ` sstrasser at systemhaus-gruppe dot de
@ 2005-02-23 20:44 ` pinskia at gcc dot gnu dot org
  2005-02-28 22:11 ` [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function bangerth at dealii dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-23 20:44 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #8266|text/x-c++src               |text/plain
          mime type|                            |


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


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

* [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
                   ` (2 preceding siblings ...)
  2005-02-23 20:44 ` pinskia at gcc dot gnu dot org
@ 2005-02-28 22:11 ` bangerth at dealii dot org
  2005-04-09 10:59 ` sstrasser at systemhaus-gruppe dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2005-02-28 22:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2005-02-28 15:53 -------
I believe the code is invalid: you try to do a partial specialization of 
a member function, but there is no such thing -- you need to use an overload 
instead. To me this looks like an accept-invalid. Here's what icc has to 
say: 
 
g/x> icc -Xc -ansi -c x.cc 
x.cc(10): error: declaration is incompatible with function template "void 
A<AT>::function(T) [with AT=int]" (declared at line 5) 
  void A<int>::function(TTT *){std::cerr << '2';} 
               ^ 
 
x.cc(16): warning #592: variable "b" is used before its value is set 
    a.function(b); 
               ^ 
 
compilation aborted for x.cc (code 2) 
 
This also seems like a regression to me, since gcc2.95.3 gives me this: 
g/x> /home/bangerth/bin/gcc-2*/bin/c++ -c x.cc -ansi -pedantic 
x.cc:10: template parameters specified in specialization 
x.cc:10: prototype for `void A<int>::function(TTT *)' does not match any in 
class `A<int>' 
x.cc:5: candidate is: template <class T> void A<int>::function<T>(T) 
x.cc: In method `void A<int>::function(TTT *)': 
x.cc:10: must specialize `struct A<int>' before defining member `void 
A<int>::function(TTT *)' 
x.cc:10: template definition of non-template `void A<int>::function(TTT *)' 
 
W. 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
      Known to fail|                            |3.2.3 3.3.5 3.4.3 4.0.0
      Known to work|                            |2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-28 15:54:00
               date|                            |
            Summary|Wrong template function     |[3.3/3.4/4.0/4.1 regression]
                   |specialization chosen       |gcc accepts invalid partial
                   |                            |specialization attempt of
                   |                            |member function
   Target Milestone|---                         |3.4.4


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


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

* [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
                   ` (3 preceding siblings ...)
  2005-02-28 22:11 ` [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function bangerth at dealii dot org
@ 2005-04-09 10:59 ` sstrasser at systemhaus-gruppe dot de
  2005-05-19 17:25 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-04-09 10:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sstrasser at systemhaus-gruppe dot de  2005-04-09 10:59 -------
is still accepted by 4.0 although 20157 is fixed now

-- 


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


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

* [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
                   ` (4 preceding siblings ...)
  2005-04-09 10:59 ` sstrasser at systemhaus-gruppe dot de
@ 2005-05-19 17:25 ` mmitchel at gcc dot gnu dot org
  2005-07-22 21:15 ` [Bug c++/20173] [3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
  2005-09-27 16:10 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:25 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

* [Bug c++/20173] [3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
                   ` (5 preceding siblings ...)
  2005-05-19 17:25 ` mmitchel at gcc dot gnu dot org
@ 2005-07-22 21:15 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:10 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 21:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-22 21:13 -------
Moving to 4.0.2 pre Mark.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |4.0.2


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


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

* [Bug c++/20173] [3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
  2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
                   ` (6 preceding siblings ...)
  2005-07-22 21:15 ` [Bug c++/20173] [3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
@ 2005-09-27 16:10 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:10 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

* [Bug c++/20173] [3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
       [not found] <bug-20173-7611@http.gcc.gnu.org/bugzilla/>
  2005-10-23 17:46 ` mmitchel at gcc dot gnu dot org
@ 2005-10-31  2:46 ` mmitchel at gcc dot gnu dot org
  1 sibling, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-31  2:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mmitchel at gcc dot gnu dot org  2005-10-31 02:46 -------
Leaving as P2; I've been tinkering with a possible patch.


-- 


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


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

* [Bug c++/20173] [3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function
       [not found] <bug-20173-7611@http.gcc.gnu.org/bugzilla/>
@ 2005-10-23 17:46 ` mmitchel at gcc dot gnu dot org
  2005-10-31  2:46 ` mmitchel at gcc dot gnu dot org
  1 sibling, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-23 17:46 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

end of thread, other threads:[~2005-10-31  2:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-23 20:38 [Bug c++/20173] New: Wrong template function specialization chosen sstrasser at systemhaus-gruppe dot de
2005-02-23 20:41 ` [Bug c++/20173] " sstrasser at systemhaus-gruppe dot de
2005-02-23 20:43 ` sstrasser at systemhaus-gruppe dot de
2005-02-23 20:44 ` pinskia at gcc dot gnu dot org
2005-02-28 22:11 ` [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function bangerth at dealii dot org
2005-04-09 10:59 ` sstrasser at systemhaus-gruppe dot de
2005-05-19 17:25 ` mmitchel at gcc dot gnu dot org
2005-07-22 21:15 ` [Bug c++/20173] [3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
2005-09-27 16:10 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-20173-7611@http.gcc.gnu.org/bugzilla/>
2005-10-23 17:46 ` mmitchel at gcc dot gnu dot org
2005-10-31  2:46 ` mmitchel 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).