public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15453] New: Friend declaration not treated as a declaration in scope.
@ 2004-05-15 18:25 igodard at pacbell dot net
  2004-05-15 18:41 ` [Bug c++/15453] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: igodard at pacbell dot net @ 2004-05-15 18:25 UTC (permalink / raw)
  To: gcc-bugs

In the following example:

template<typename G, template<typename H> class I = B>
class J;

template<typename C, template<typename D> class E>
class F {
    template<typename G, template<typename H> class I = B>
    friend
    class J;
    template<typename K, template<typename L> class M = B>
    friend
    class N;
    friend
    class O;

    J<int, B>* j;
    N<int, B>* n;
    O* o;
    };

int main() {
    return 0;
    }

N appears to not be recognized as a template (in the declaration of n) based on its declaration as a template friend, whereas exactly the same declaration with an additional declaration in file scope is acceptable (template class J, declaring j), as is a friend declaration of a plain class. The c++ rules in this area are incomprehensible to me, but admitting friend declarations in one case and not the other seems unreasonable if not incorrect.

Ivan

-- 
           Summary: Friend declaration not treated as a declaration in
                    scope.
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-05-22 14:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-15 18:25 [Bug c++/15453] New: Friend declaration not treated as a declaration in scope igodard at pacbell dot net
2004-05-15 18:41 ` [Bug c++/15453] " pinskia at gcc dot gnu dot org
2004-05-15 18:42 ` pinskia at gcc dot gnu dot org
2004-05-15 21:48 ` [Bug c++/15453] Friend declaration " giovannibajo at libero dot it
2004-05-15 21:57 ` giovannibajo at libero dot it
2004-08-12  0:58 ` pinskia at gcc dot gnu dot org
2004-10-13 15:21 ` lerdsuwa at gcc dot gnu dot org
2004-12-28 15:30 ` lerdsuwa at gcc dot gnu dot org
2005-05-22 11:44 ` lerdsuwa at gcc dot gnu dot org
2005-05-22 14:06 ` 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).