This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/39269] New: Invalid template friend declaration accepted
- From: "bangerth at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Feb 2009 03:27:12 -0000
- Subject: [Bug c++/39269] New: Invalid template friend declaration accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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