This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/21244] Confusion in template instantiation
- From: "dominik dot strasser at infineon dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Apr 2005 09:08:02 -0000
- Subject: [Bug libstdc++/21244] Confusion in template instantiation
- References: <20050427065222.21244.dominik.strasser@infineon.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dominik dot strasser at infineon dot com 2005-04-27 09:07 -------
(In reply to comment #4)
> The second example seems to me also a duplicate of 19404. This is a reduced
> testcase:
>
> class Foo { };
> template<class T> void operator/(const Foo&, T);
> enum { _S_word_bit = 1 };
> class vector_bool
> { void _M_allocate() { (_S_word_bit - 1) / _S_word_bit; } };
> vector_bool bar;
>
> Andrew, can you confirm?
The following patch cures the problem for me:
--- ./libstdc++-v3/include/bits/stl_bvector.h 2005-01-31 17:21:55.000000000 +0100
+++ /tmp/stl_bvector.h 2005-04-27 11:05:44.000000000 +0200
@@ -64,7 +64,7 @@
namespace _GLIBCXX_STD
{
typedef unsigned long _Bit_type;
- enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) };
+ static const int _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type));
struct _Bit_reference
{
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21244