Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2005-03-13 10:09:08


----- Mensaje original -----
De: Peter Dimov <pdimov_at_[hidden]>
Fecha: Domingo, Marzo 13, 2005 2:18 pm
Asunto: Re: [boost] [aligned_storage][repost] problems with GCC 4.0.0
        20050309

> JOAQUIN LOPEZ MU?Z wrote:
> > The class aligned_storage in boost/aligned_storage.hpp has
> > the following decl:
> >
> > template <
> > std::size_t size_
> > , std::size_t alignment_ = std::size_t(-1)
> >>
> > class aligned_storage;
> >
> > GCC 4.0 complains about the default value for aligmnent_ saying
> > that:
> >
> > '(size_t)((-1))' is not a valid template argument for type
> > 'unsigned int' because it is a non-constant expression
> >
> > which is ruining some of the regression tests.
> > Is GCC right or shall I submit a bug report at gcc.gnu.org/bugzilla?
>
> I don't see anything in the standard or in the issue lists that
> prohibits
> size_t(-1) as an integral constant expression. Bug report.
>

Alas, I tried to isolate this into a simple snippet

#include <cstddef>

template <
     std::size_t size_
   , std::size_t alignment_ = std::size_t(-1)>
class aligned_storage
{
};

int main()
{
  aligned_storage<1> as;
}

but then the problem goes away. Would some kind
soul with access to GCC 4.0.0 care to take a look
at this? The actual problem is shown at:

http://tinyurl.com/4hxy5

Thank you very much,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk