This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/39269] New: Invalid template friend declaration accepted


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]