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 libstdc++/21244] Confusion in template instantiation


------- 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


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