[Bug c++/39269] New: Invalid template friend declaration accepted
bangerth at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Feb 23 03:27:00 GMT 2009
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
More information about the Gcc-bugs
mailing list