public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39269]  New: Invalid template friend declaration accepted
@ 2009-02-23  3:27 bangerth at gmail dot com
  2009-02-23  9:58 ` [Bug c++/39269] " rguenth at gcc dot gnu dot org
  2010-05-02 14:44 ` redi at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: bangerth at gmail dot com @ 2009-02-23  3:27 UTC (permalink / raw)
  To: gcc-bugs

This code has erroneously been accepted since at least gcc 2.95:
--------------------------
namespace NS {
  template <int A, int B> class X {};
}

class Y {
    template <int> friend class NS::X;
};
--------------------------
Note the wrong number of template arguments in the friend declaration.
The code is correctly rejected if X is not in a namespace.

W.


-- 
           Summary: Invalid template friend declaration accepted
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at gmail dot com


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


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

end of thread, other threads:[~2013-07-01  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-39269-4@http.gcc.gnu.org/bugzilla/>
2013-07-01  9:13 ` [Bug c++/39269] Invalid template friend declaration accepted paolo.carlini at oracle dot com
2009-02-23  3:27 [Bug c++/39269] New: " bangerth at gmail dot com
2009-02-23  9:58 ` [Bug c++/39269] " rguenth at gcc dot gnu dot org
2010-05-02 14:44 ` redi 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).