This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24298] New: Libstdc++ uses anonymous enums, causing failures due to DR488
- From: "ianmcc at physik dot rwth-aachen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2005 16:27:58 -0000
- Subject: [Bug libstdc++/24298] New: Libstdc++ uses anonymous enums, causing failures due to DR488
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
g++ -c the attached sample fails with
/usr/include/g++/bits/stl_algo.h: In function `void
std::__final_insertion_sort(_RandomAccessIter, _RandomAccessIter) [with
_RandomAccessIter = __gnu_cxx::__normal_iterator<foo*, std::vector<foo,
std::allocator<foo> > >]':
/usr/include/g++/bits/stl_algo.h:2181: instantiated from `void
std::sort(_RandomAccessIter, _RandomAccessIter) [with _RandomAccessIter =
__gnu_cxx::__normal_iterator<foo*, std::vector<foo, std::allocator<foo> > >]'
testenum.cpp:21: instantiated from here
/usr/include/g++/bits/stl_algo.h:2059: error: template-argument `
std::<anonymous enum>' uses anonymous type
/usr/include/g++/bits/stl_algo.h:2181: instantiated from `void
std::sort(_RandomAccessIter, _RandomAccessIter) [with _RandomAccessIter =
__gnu_cxx::__normal_iterator<foo*, std::vector<foo, std::allocator<foo> > >]'
testenum.cpp:21: instantiated from here
/usr/include/g++/bits/stl_algo.h:2060: error: template-argument `
std::<anonymous enum>' uses anonymous type
The problem: std::sort (and other components of libstdc++) use anonymmous
enumerations for private constants. However if there is a template
operator/function in an associated namespace that uses SFINAE, it will fail
according to 14.3.1/2.
The resolution of DR-488 will surely fix this, presumably by making the
substitution fail (without error), but irrespective of this DR, I cannot find
anything in the standard that suggests that the attached code is
non-conforming.
--
Summary: Libstdc++ uses anonymous enums, causing failures due to
DR488
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ianmcc at physik dot rwth-aachen dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24298