public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43558] [4.5 Regression] Rejects specialization
  2010-03-28 17:46 [Bug c++/43558] New: [4.5 Regression] Rejects specialization rguenth at gcc dot gnu dot org
@ 2010-03-28 17:46 ` rguenth at gcc dot gnu dot org
  2010-03-31  9:21 ` dodji at gcc dot gnu dot org
  2010-03-31  9:33 ` dodji at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-28 17:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-03-28 17:46 -------
EDG accepts both.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Priority|P3                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-28 17:46:42
               date|                            |
   Target Milestone|---                         |4.5.0


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


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

* [Bug c++/43558]  New: [4.5 Regression] Rejects specialization
@ 2010-03-28 17:46 rguenth at gcc dot gnu dot org
  2010-03-28 17:46 ` [Bug c++/43558] " rguenth at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-28 17:46 UTC (permalink / raw)
  To: gcc-bugs

Very recently we started to reject

class Compressible;
template <class T, class EngineTag> class Engine;
template <class T>
class Engine<T, Compressible>
{
public:
  typedef T Element_t;
  Element_t read(int);
};

template <class T>
T Engine<T, Compressible>::read(int)
{
}

Engine<int, Compressible> x;

with

t2.ii:12:3: error: prototype for 'T Engine<T, Compressible>::read(int)' does
not match any in class 'Engine<T, Compressible>'
t2.ii:8:13: error: candidate is: Element_t Engine<T, Compressible>::read(int)

(testcase reduced from tramp3d).

But the following is accepted:

template <class T>
class Engine
{
public:
  typedef T Element_t;
  Element_t read(int);
};

template <class T>
T Engine<T>::read(int)
{
}

Engine<int> x;


-- 
           Summary: [4.5 Regression] Rejects specialization
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

* [Bug c++/43558] [4.5 Regression] Rejects specialization
  2010-03-28 17:46 [Bug c++/43558] New: [4.5 Regression] Rejects specialization rguenth at gcc dot gnu dot org
  2010-03-28 17:46 ` [Bug c++/43558] " rguenth at gcc dot gnu dot org
@ 2010-03-31  9:21 ` dodji at gcc dot gnu dot org
  2010-03-31  9:33 ` dodji at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-03-31  9:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dodji at gcc dot gnu dot org  2010-03-31 09:21 -------
Subject: Bug 43558

Author: dodji
Date: Wed Mar 31 09:21:02 2010
New Revision: 157857

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157857
Log:
Fix PR c++/43558

gcc/cp/ChangeLog:
        PR c++/43558
        * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
        * pt.c (end_template_parm_list): Store sibling template parms of
        each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
        (push_template_decl_real): Don't store the containing template decl
        into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
        * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
        of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
        Simplify the logic.

gcc/testsuite/ChangeLog:
        PR c++/43558
        * g++.dg/template/typedef31.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/typedef31.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/43558] [4.5 Regression] Rejects specialization
  2010-03-28 17:46 [Bug c++/43558] New: [4.5 Regression] Rejects specialization rguenth at gcc dot gnu dot org
  2010-03-28 17:46 ` [Bug c++/43558] " rguenth at gcc dot gnu dot org
  2010-03-31  9:21 ` dodji at gcc dot gnu dot org
@ 2010-03-31  9:33 ` dodji at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-03-31  9:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dodji at gcc dot gnu dot org  2010-03-31 09:33 -------
Fixed in 4.5 (trunk).


-- 

dodji at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-03-31  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-28 17:46 [Bug c++/43558] New: [4.5 Regression] Rejects specialization rguenth at gcc dot gnu dot org
2010-03-28 17:46 ` [Bug c++/43558] " rguenth at gcc dot gnu dot org
2010-03-31  9:21 ` dodji at gcc dot gnu dot org
2010-03-31  9:33 ` dodji 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).