]> git.saurik.com Git - bison.git/blobdiff - data/variant.hh
c++: use __attribute__((__pure__)) to avoid warnings
[bison.git] / data / variant.hh
index 7fa68464cde3933bad39928845232a5c26f67530..76c3e60dc1081f445532f96c03c13233b93a5871 100644 (file)
@@ -63,7 +63,7 @@ m4_define([b4_char_sizeof],
 [b4_symbol_if([$1], [has_type],
 [
 m4_map([      b4_symbol_tag_comment], [$@])dnl
-      char _b4_char_sizeof_dummy@{sizeof([b4_symbol([$1], [type])])@};
+      char _b4_char_sizeof_dummy@{sizeof(b4_symbol([$1], [type]))@};
 ])])
 
 
@@ -178,8 +178,7 @@ m4_define([b4_variant_define],
     template <typename T>
     void
     move (self_type& other)
-    {]b4_parse_assert_if([
-      YYASSERT (!yytname_);])[
+    {
       build<T> ();
       swap<T> (other);
       other.destroy<T> ();
@@ -248,12 +247,12 @@ m4_define([b4_variant_define],
 # ---------------------
 # Declare semantic_type.
 m4_define([b4_value_type_declare],
-[    /// An auxiliary type to compute the largest semantic type.
+[[    /// An auxiliary type to compute the largest semantic type.
     union union_type
     {]b4_type_foreach([b4_char_sizeof])[};
 
     /// Symbol semantic values.
-    typedef variant<sizeof(union_type)> semantic_type;dnl
+    typedef variant<sizeof(union_type)> semantic_type;][]dnl
 ])
 
 
@@ -321,7 +320,6 @@ b4_join(b4_symbol_if([$1], [has_type],
     return symbol_type (b4_join([token::b4_symbol([$1], [id])],
                                 b4_symbol_if([$1], [has_type], [v]),
                                 b4_locations_if([l])));
-
   }
 
 ])])])