g++-4.3 alignas(const-expr) fails; workaround?

Larry Evans cppljevans@suddenlink.net
Fri Mar 30 12:27:00 GMT 2007


With g++-4.3-20070323, alignas(2) fails compile with
message indicating it needs a type instead of
constant expression.  Is there any workaround.
For example, could I:

  typedef unsigned char work_around[const-expr];
  unsigned char alignas(work_around) actual_var[const-expr]

?
TIA.

-Larry



More information about the Gcc-help mailing list