public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16067] New: scope resolution failure on base class members when derived and base classes are templates
@ 2004-06-18 23:03 aac76 at bellsouth dot net
  2004-06-18 23:05 ` [Bug c++/16067] " aac76 at bellsouth dot net
  2004-06-18 23:07 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 5+ messages in thread
From: aac76 at bellsouth dot net @ 2004-06-18 23:03 UTC (permalink / raw)
  To: gcc-bugs

gcc -v 
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.0/specs 
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--disable-checking --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --host=i386-redhat-linux 
Thread model: posix 
gcc version 3.4.0 20040613 (Red Hat Linux 3.4.0-5) 
 
The following code works great in GCC 3.3.x but chokes in 3.4.0: 
 
template<class T> 
class A 
{ 
protected: 
  T t_; 
}; 
 
template<class T> 
class B: public A<T> 
{ 
public: 
  B() 
  { 
    t_; 
  } 
}; 
 
int main(int argc, char** argv) 
{ 
  B<int> b; 
} 
 
GCC 3.4.0 produces the following error on this code: 
bug.cc: In constructor `B<T>::B()': 
bug.cc:14: error: `t_' undeclared (first use this function) 
bug.cc:14: error: (Each undeclared identifier is reported only once for each 
function it appears in.) 
 
Simply changing the "t_;" line inside B's ctor to "A<T>::t_;" causes it to 
smarten up, but it doesn't seem like explicit scope resolution should be 
required in this context.  Also, the problem only appears when B's template 
argument is passed along to A.  If B explicitly specializes A it works fine 
too.

-- 
           Summary: scope resolution failure on base class members when
                    derived and base classes are templates
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aac76 at bellsouth dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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


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

* [Bug c++/16067] scope resolution failure on base class members when derived and base classes are templates
  2004-06-18 23:03 [Bug c++/16067] New: scope resolution failure on base class members when derived and base classes are templates aac76 at bellsouth dot net
@ 2004-06-18 23:05 ` aac76 at bellsouth dot net
  2004-06-18 23:07 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: aac76 at bellsouth dot net @ 2004-06-18 23:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From aac76 at bellsouth dot net  2004-06-18 23:05 -------
Created an attachment (id=6572)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6572&action=view)
testcase


-- 


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


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

* [Bug c++/16067] scope resolution failure on base class members when derived and base classes are templates
  2004-06-18 23:03 [Bug c++/16067] New: scope resolution failure on base class members when derived and base classes are templates aac76 at bellsouth dot net
  2004-06-18 23:05 ` [Bug c++/16067] " aac76 at bellsouth dot net
@ 2004-06-18 23:07 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-18 23:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-18 23:07 -------
Did you read the changes page <http://gcc.gnu.org/gcc-3.4/changes.html> at all?

This is listed there.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug c++/16067] scope resolution failure on base class members when derived and base classes are templates
       [not found] <bug-16067-8762@http.gcc.gnu.org/bugzilla/>
  2006-01-13 15:46 ` pinskia at gcc dot gnu dot org
@ 2006-01-13 15:47 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-13 15:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-01-13 15:46 -------
close as a dup of bug 12970.

*** This bug has been marked as a duplicate of 12970 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c++/16067] scope resolution failure on base class members when derived and base classes are templates
       [not found] <bug-16067-8762@http.gcc.gnu.org/bugzilla/>
@ 2006-01-13 15:46 ` pinskia at gcc dot gnu dot org
  2006-01-13 15:47 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-13 15:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-01-13 15:46 -------
Reopening to ..


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


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


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

end of thread, other threads:[~2006-01-13 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-18 23:03 [Bug c++/16067] New: scope resolution failure on base class members when derived and base classes are templates aac76 at bellsouth dot net
2004-06-18 23:05 ` [Bug c++/16067] " aac76 at bellsouth dot net
2004-06-18 23:07 ` pinskia at gcc dot gnu dot org
     [not found] <bug-16067-8762@http.gcc.gnu.org/bugzilla/>
2006-01-13 15:46 ` pinskia at gcc dot gnu dot org
2006-01-13 15:47 ` pinskia 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).