public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25855]  New: template specialisation not always found
@ 2006-01-19 11:11 mueller at kde dot org
  2006-01-19 11:12 ` [Bug c++/25855] " mueller at kde dot org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: mueller at kde dot org @ 2006-01-19 11:11 UTC (permalink / raw)
  To: gcc-bugs

there seems to be a possibly a regression in c++ 4.0.2 / 4.1 and newer
depending on if BREAK and WORKAROUND is not defined in the attached testcase. 

I'm not 100% sure if this is defined behavior or not, or if the WORKAROUND is
actually the correct solution. So it varies between wrong-code, accepts-invalid
and invalid testcase. Input needed.


-- 
           Summary: template specialisation not always found
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mueller at kde dot org
  GCC host triplet: i686-unknown-linux


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


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

* [Bug c++/25855] template specialisation not always found
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
@ 2006-01-19 11:12 ` mueller at kde dot org
  2006-01-19 11:13 ` mueller at kde dot org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mueller at kde dot org @ 2006-01-19 11:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mueller at kde dot org  2006-01-19 11:12 -------
Created an attachment (id=10674)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10674&action=view)
testcase


-- 


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


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

* [Bug c++/25855] template specialisation not always found
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
  2006-01-19 11:12 ` [Bug c++/25855] " mueller at kde dot org
@ 2006-01-19 11:13 ` mueller at kde dot org
  2006-01-19 13:09 ` rguenth at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mueller at kde dot org @ 2006-01-19 11:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mueller at kde dot org  2006-01-19 11:13 -------
attaching testcase inline for better bugzilla queries: 

#ifdef BREAK
    template <typename T>               bool qCompare(const T *t1, const T
*t2);
    template <typename T>               bool qCompare(T *t1, T *t2);
#else
    template <typename T>               bool qCompare(T *t1, T *t2);
    template <typename T>               bool qCompare(const T *t1, const T
*t2);
#endif
    template <typename T1, typename T2> bool qCompare(const T1 *t1, const T2
*t2);
#ifdef WORKAROUND
    template<>                          bool qCompare<char>(const char *t1,
const char *t2)
#else
    template<>                          bool qCompare(const char *t1, const
char *t2)
#endif
    {
      return true;
    }

int main()
{
  return !qCompare("a", "b");
}


-- 


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


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

* [Bug c++/25855] template specialisation not always found
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
  2006-01-19 11:12 ` [Bug c++/25855] " mueller at kde dot org
  2006-01-19 11:13 ` mueller at kde dot org
@ 2006-01-19 13:09 ` rguenth at gcc dot gnu dot org
  2006-01-19 13:15 ` rguenth at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-19 13:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-01-19 13:09 -------
14.7.3/11 and /12 suggest, that while having the template-argument unspecified
in the template-id is valid only if the template-argument can be deduced from
the function arguments unambiguously (it does not say if a diagnostic is
required).  For the example:

template <typename T>  bool qCompare(const T *t1, const T *t2);
template <typename T>  bool qCompare(T *t1, T *t2);
template <typename T1, typename T2> bool qCompare(const T1 *t1, const T2 *t2);
template<> bool qCompare(const char *t1, const char *t2) {}

it is ambiguous whether the specialization uses the template-argument const
char
or char.  See example in /12.

Whether the gcc behavior to just ignore this decl as a specialization is
correct or not I don't know.  Needless to say, EDG accepts the testcase without
problems...

As an advice to the programmer I would say -DWORKAROUND is a good way to
avoid the ambiguity.


-- 


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


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

* [Bug c++/25855] template specialisation not always found
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (2 preceding siblings ...)
  2006-01-19 13:09 ` rguenth at gcc dot gnu dot org
@ 2006-01-19 13:15 ` rguenth at gcc dot gnu dot org
  2006-01-19 13:36 ` [Bug c++/25855] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-19 13:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2006-01-19 13:15 -------
So, for

template <typename T>  int qCompare(const T *t1, const T *t2) { return 1; }
template <typename T>  int qCompare(T *t1, T *t2) { return 2; }
template <typename T1, typename T2> int qCompare(const T1 *t1, const T2 *t2) {
return 3; }
template<> int qCompare(const char *t1, const char *t2) { return 4; }
int main()
{
  return qCompare("a", "b");
}

gcc returns 1, if you swap the first two decls it returns 4, likewise if you
remove the function that returns 3 regardless of ordering of the first two
lines.

So, the bug is it should unconditionally return 4 or diagnose the ambiguous
specialization.


-- 

rguenth 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-01-19 13:15:22
               date|                            |


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (3 preceding siblings ...)
  2006-01-19 13:15 ` rguenth at gcc dot gnu dot org
@ 2006-01-19 13:36 ` pinskia at gcc dot gnu dot org
  2006-01-19 13:42 ` pinskia at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 13:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-01-19 13:36 -------
Note, this is very much related to PR 19203 and PR 4672 and DRs 214.


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (4 preceding siblings ...)
  2006-01-19 13:36 ` [Bug c++/25855] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-19 13:42 ` pinskia at gcc dot gnu dot org
  2006-01-19 13:53 ` [Bug c++/25855] template specialisation not always found (partial ordering) pinskia at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 13:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-01-19 13:42 -------
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#214

DR 214 describes what is going on here dead on but I don't really understand
what is the expected behavior.


-- 


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


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

* [Bug c++/25855] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (5 preceding siblings ...)
  2006-01-19 13:42 ` pinskia at gcc dot gnu dot org
@ 2006-01-19 13:53 ` pinskia at gcc dot gnu dot org
  2006-01-19 14:13 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 13:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-01-19 13:53 -------
This is also related to PR 12536.  I don't think should have been marked as new
if it was not obvious if this a bug or not.

Nathan,
  Can you look at this like you did with the other three PRs and see if this is
what is expected from that Defect report?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at gcc dot gnu dot
                   |                            |org
            Summary|[4.0/4.1/4.2 Regression]    |template specialisation not
                   |template specialisation not |always found (partial
                   |always found (partial       |ordering)
                   |ordering)                   |


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


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

* [Bug c++/25855] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (6 preceding siblings ...)
  2006-01-19 13:53 ` [Bug c++/25855] template specialisation not always found (partial ordering) pinskia at gcc dot gnu dot org
@ 2006-01-19 14:13 ` pinskia at gcc dot gnu dot org
  2006-01-19 14:22 ` nathan at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 14:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2006-01-19 14:13 -------
14.7.3/12 has been removed by DR 64.


-- 


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


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

* [Bug c++/25855] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (7 preceding siblings ...)
  2006-01-19 14:13 ` pinskia at gcc dot gnu dot org
@ 2006-01-19 14:22 ` nathan at gcc dot gnu dot org
  2006-01-19 14:29 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-01-19 14:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from nathan at gcc dot gnu dot org  2006-01-19 14:22 -------
The bug appears to be not in the deduction machinery, but in the instantiation
machinery.  In all cases we end up calling _Z8qCompareIcEiPKT_S2_, but the body
of that function differs!  Using the example in comment #4, we get a return
value of 1.  If either of the two alterations are done, we get a return value
of 4.

Another difference in the assembly is that the unmodified code of comment #4
contains an instantiation of _Z8qCompareIccEiPKT_PKT0_, whereas the other two
do not.


-- 


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


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

* [Bug c++/25855] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (8 preceding siblings ...)
  2006-01-19 14:22 ` nathan at gcc dot gnu dot org
@ 2006-01-19 14:29 ` pinskia at gcc dot gnu dot org
  2006-01-19 14:43 ` nathan at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 14:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2006-01-19 14:29 -------
Here is what is happening here:
template <typename T>  int qCompare(const T *t1, const T *t2) { return 1; }
template <typename T>  int qCompare(T *t1, T *t2) { return 2; }
template <typename T1, typename T2> int qCompare(const T1 *t1, const T2 *t2) {
return 3; }
template<> int qCompare(const char *t1, const char *t2) { return 4; }

The last qCompare is specializing qCompare(const T1 *t1, const T2 *t2) but we
are choosing the first one as shown by the example DR 214.

So I think this bug is in fact invalid and GCC is doing the correct thing
according to these DR's.


-- 


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


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

* [Bug c++/25855] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (9 preceding siblings ...)
  2006-01-19 14:29 ` pinskia at gcc dot gnu dot org
@ 2006-01-19 14:43 ` nathan at gcc dot gnu dot org
  2006-01-21  1:24 ` janis at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-01-19 14:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from nathan at gcc dot gnu dot org  2006-01-19 14:43 -------
comment #10 is incorrect.  Regardless of the validity/invalidity of the code,
the fact that comment#4 shows us producing different code depending on the
ordering of the template decls indicates a bug.  (I also fail to see the
relevancy of DR214, as there are no undeduceable template parameters, nor any
reference arguments.)


-- 


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


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

* [Bug c++/25855] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (10 preceding siblings ...)
  2006-01-19 14:43 ` nathan at gcc dot gnu dot org
@ 2006-01-21  1:24 ` janis at gcc dot gnu dot org
  2006-01-23 16:27 ` [Bug c++/25855] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: janis at gcc dot gnu dot org @ 2006-01-21  1:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from janis at gcc dot gnu dot org  2006-01-21 01:24 -------
A regression hunt of the trunk on powerpc-linux using the testcase in comment
#4 (modified to abort if the result is not 4) identified the following patch to
fix several C++ bugs:

http://gcc.gnu.org/viewcvs?view=rev&rev=105365

r105365 | mmitchel | 2005-10-13 08:38:40 +0000 (Thu, 13 Oct 2005)

The same fixes were added to the 4.0-branch, again as a single patch.


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (11 preceding siblings ...)
  2006-01-21  1:24 ` janis at gcc dot gnu dot org
@ 2006-01-23 16:27 ` pinskia at gcc dot gnu dot org
  2006-01-25  6:30 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-23 16:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|template specialisation not |[4.0/4.1/4.2 Regression]
                   |always found (partial       |template specialisation not
                   |ordering)                   |always found (partial
                   |                            |ordering)
   Target Milestone|---                         |4.1.0


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (12 preceding siblings ...)
  2006-01-23 16:27 ` [Bug c++/25855] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-25  6:30 ` mmitchel at gcc dot gnu dot org
  2006-01-28  3:27 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-25  6:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from mmitchel at gcc dot gnu dot org  2006-01-25 06:30 -------
We need to fix this.


-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (13 preceding siblings ...)
  2006-01-25  6:30 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28  3:27 ` mmitchel at gcc dot gnu dot org
  2006-01-28  4:13 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28  3:27 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=25855


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (14 preceding siblings ...)
  2006-01-28  3:27 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28  4:13 ` mmitchel at gcc dot gnu dot org
  2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28  4:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from mmitchel at gcc dot gnu dot org  2006-01-28 04:13 -------
For the code in Comment #4, there are two questions:

1. Which of the three template functions is called by main?

2. Which of the three template functions is specialized by the explicit
specialization?

The type of the string literals is "const char*".  So, the call matches all
three templates, with { T : char }, { T : const char }, and { T1 : char, T2 :
char}, respectively.  Since the argument types are "const char*" in all cases,
overload resolution selects the most specialized of the three templates.  The
first template is more specialized than the second, since the first template
can be generated from the second with { T : const T}, but the second cannot be
generated from the first.  The first template is also more specialized than the
third, since it can be generated from the first with { T1 : T, T2 : T }.  Thus,
it is the first template that is called.

Because explicit specializations also specialized the most specialized
template, the answer to the second question is the same; it is the first
template which is specialized.

Therefore, the correct value is indeed 4.


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (16 preceding siblings ...)
  2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
  2006-01-28 19:25 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28 19:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from mmitchel at gcc dot gnu dot org  2006-01-28 19:24 -------
Subject: Bug 25855

Author: mmitchel
Date: Sat Jan 28 19:24:03 2006
New Revision: 110329

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110329
Log:
        PR c++/25855
        * pt.c (most_speialized_instantiation): When a tie occurs, set the
        current presumed champion to the next template.
        PR c++/25855
        * g++.dg/template/spec29.C: New test.
        * g++.dg/template/crash39.C: Tweak error markers.

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


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (15 preceding siblings ...)
  2006-01-28  4:13 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
  2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28 19:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from mmitchel at gcc dot gnu dot org  2006-01-28 19:24 -------
Subject: Bug 25855

Author: mmitchel
Date: Sat Jan 28 19:24:11 2006
New Revision: 110330

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110330
Log:
        PR c++/25855
        * pt.c (most_speialized_instantiation): When a tie occurs, set the
        current presumed champion to the next template.
        PR c++/25855
        * g++.dg/template/spec29.C: New test.
        * g++.dg/template/crash39.C: Tweak error markers.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/spec29.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/pt.c
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash39.C


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (17 preceding siblings ...)
  2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28 19:25 ` mmitchel at gcc dot gnu dot org
  2006-01-28 19:28 ` mmitchel at gcc dot gnu dot org
  2006-01-28 19:37 ` mmitchel at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28 19:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from mmitchel at gcc dot gnu dot org  2006-01-28 19:24 -------
Subject: Bug 25855

Author: mmitchel
Date: Sat Jan 28 19:24:45 2006
New Revision: 110331

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110331
Log:
        PR c++/25855
        * pt.c (most_speialized_instantiation): When a tie occurs, set the
        current presumed champion to the next template.
        PR c++/25855
        * g++.dg/template/spec29.C: New test.
        * g++.dg/template/crash39.C: Tweak error markers.

Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (18 preceding siblings ...)
  2006-01-28 19:25 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28 19:28 ` mmitchel at gcc dot gnu dot org
  2006-01-28 19:37 ` mmitchel at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28 19:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from mmitchel at gcc dot gnu dot org  2006-01-28 19:28 -------
Subject: Bug 25855

Author: mmitchel
Date: Sat Jan 28 19:28:01 2006
New Revision: 110332

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110332
Log:
        PR c++/25855
        * class.c (resolve_address_of_overloaded_function): Adjust use of
        return value from most_specialized_instantiation.
        * pt.c (determine_specialization): Avoid multiple calls to
        get_bindings.
        (most_specialized_instantiation): When a tie occurs, set the
        current presumed champion to the next template.  Return the
        TREE_LIST node containing the template, rather than the template
        itself.
        (most_specialized): Remove.
        * name-lookup.c (push_overloaded_decl): When duplicate_decls
        indicates a failed redeclaration, report that to callers.
        PR c++/25855
        * g++.dg/template/spec29.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/spec29.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/25855] [4.0/4.1/4.2 Regression] template specialisation not always found (partial ordering)
  2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
                   ` (19 preceding siblings ...)
  2006-01-28 19:28 ` mmitchel at gcc dot gnu dot org
@ 2006-01-28 19:37 ` mmitchel at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-28 19:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from mmitchel at gcc dot gnu dot org  2006-01-28 19:37 -------
Fixed in 4.0.3.


-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-01-28 19:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-19 11:11 [Bug c++/25855] New: template specialisation not always found mueller at kde dot org
2006-01-19 11:12 ` [Bug c++/25855] " mueller at kde dot org
2006-01-19 11:13 ` mueller at kde dot org
2006-01-19 13:09 ` rguenth at gcc dot gnu dot org
2006-01-19 13:15 ` rguenth at gcc dot gnu dot org
2006-01-19 13:36 ` [Bug c++/25855] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-01-19 13:42 ` pinskia at gcc dot gnu dot org
2006-01-19 13:53 ` [Bug c++/25855] template specialisation not always found (partial ordering) pinskia at gcc dot gnu dot org
2006-01-19 14:13 ` pinskia at gcc dot gnu dot org
2006-01-19 14:22 ` nathan at gcc dot gnu dot org
2006-01-19 14:29 ` pinskia at gcc dot gnu dot org
2006-01-19 14:43 ` nathan at gcc dot gnu dot org
2006-01-21  1:24 ` janis at gcc dot gnu dot org
2006-01-23 16:27 ` [Bug c++/25855] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-01-25  6:30 ` mmitchel at gcc dot gnu dot org
2006-01-28  3:27 ` mmitchel at gcc dot gnu dot org
2006-01-28  4:13 ` mmitchel at gcc dot gnu dot org
2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
2006-01-28 19:24 ` mmitchel at gcc dot gnu dot org
2006-01-28 19:25 ` mmitchel at gcc dot gnu dot org
2006-01-28 19:28 ` mmitchel at gcc dot gnu dot org
2006-01-28 19:37 ` 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).