public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13935] New: [3.4/3.5 Regression] Template friend lookup bug
@ 2004-01-30 16:50 giovannibajo at libero dot it
  2004-01-30 16:50 ` [Bug c++/13935] " giovannibajo at libero dot it
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-30 16:50 UTC (permalink / raw)
  To: gcc-bugs

Posted by MattT originally within PR13813, but it's not related to that bug so 
I moved it to a different PR.

----------------------------------------------
template < class TP1 >
class MainClass {
public:
  
  class A;
  
  friend class B;
  
  A a;
  
  template < class TP2 > class B {};
  
  class A {
    
    template < class TP2 > friend class B;
    
  };
  
};

int main(int argc, char *argv[]) {
  MainClass<int> var;
}
----------------------------------------------
matt.cc: At global scope:
matt.cc: In instantiation of `MainClass<int>::A':
matt.cc:9:   instantiated from `MainClass<int>'
matt.cc:22:   instantiated from here
matt.cc:13: error: `template<class TP2> struct MainClass<int>::B' redeclared as 
different kind of symbol
matt.cc:13: error: previous declaration of `struct B'


EDG is confused because it refuses the definition of variable "a" at parsing 
time (which is wrong, since its type is dependent - MainClass<T>::A - even 
under DR224). 

It *looks* like the code should be accepted to me.

-- 
           Summary: [3.4/3.5 Regression] Template friend lookup bug
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org,mattyt-bugzilla at tpg
                    dot com dot au


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


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

end of thread, other threads:[~2004-02-03  9:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-30 16:50 [Bug c++/13935] New: [3.4/3.5 Regression] Template friend lookup bug giovannibajo at libero dot it
2004-01-30 16:50 ` [Bug c++/13935] " giovannibajo at libero dot it
2004-01-30 17:10 ` bangerth at dealii dot org
2004-01-30 17:45 ` gdr at integrable-solutions dot net
2004-01-30 17:58 ` giovannibajo at libero dot it
2004-01-30 19:23 ` gdr at integrable-solutions dot net
2004-02-02  2:16 ` giovannibajo at libero dot it
2004-02-02  2:27 ` gdr at integrable-solutions dot net
2004-02-02  2:35 ` giovannibajo at libero dot it
2004-02-03  9:22 ` 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).