bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] c++: variants: minor simplification


From: Akim Demaille
Subject: [PATCH 4/4] c++: variants: minor simplification
Date: Sun, 13 Sep 2020 14:42:39 +0200

Do as Valentin Tolmer did in glr2.cc.

* data/skeletons/variant.hh: The union does not need to be named.
---
 data/skeletons/variant.hh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/data/skeletons/variant.hh b/data/skeletons/variant.hh
index c37bdd42..a4f7e38a 100644
--- a/data/skeletons/variant.hh
+++ b/data/skeletons/variant.hh
@@ -102,7 +102,7 @@ m4_define([b4_value_type_declare],
 
     /// Empty construction.
     semantic_type () YY_NOEXCEPT
-      : yybuffer_ ()]b4_parse_assert_if([
+      : yyraw_ ()]b4_parse_assert_if([
       , yytypeid_ (YY_NULLPTR)])[
     {}
 
@@ -277,7 +277,7 @@ m4_define([b4_value_type_declare],
     T*
     yyas_ () YY_NOEXCEPT
     {
-      void *yyp = yybuffer_.yyraw;
+      void *yyp = yyraw_;
       return static_cast<T*> (yyp);
      }
 
@@ -286,7 +286,7 @@ m4_define([b4_value_type_declare],
     const T*
     yyas_ () const YY_NOEXCEPT
     {
-      const void *yyp = yybuffer_.yyraw;
+      const void *yyp = yyraw_;
       return static_cast<const T*> (yyp);
      }
 
@@ -301,10 +301,10 @@ m4_define([b4_value_type_declare],
     union
     {
       /// Strongest alignment constraints.
-      long double yyalign_me;
+      long double yyalign_me_;
       /// A buffer large enough to store any of the semantic values.
-      char yyraw[size];
-    } yybuffer_;]b4_parse_assert_if([
+      char yyraw_[size];
+    };]b4_parse_assert_if([
 
     /// Whether the content is built: if defined, the name of the stored type.
     const std::type_info *yytypeid_;])[
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]