bison-patches
[Top][All Lists]
Advanced

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

master: C++: remove useless calls to the base default constructor


From: Akim Demaille
Subject: master: C++: remove useless calls to the base default constructor
Date: Sun, 12 Aug 2018 15:31:36 +0200

Will be installed soon, unless someone disagrees.

commit af1760f9db3d3bee08ffe6c50a8109e367a95e19
Author: Akim Demaille <address@hidden>
Date:   Sun Aug 12 14:46:39 2018 +0200

    C++: remove useless calls to the base default constructor
    
    * data/c++.m4, data/stack.hh, data/variant.hh: here.

diff --git a/data/c++.m4 b/data/c++.m4
index 2d2a5957..3eca8009 100644
--- a/data/c++.m4
+++ b/data/c++.m4
@@ -297,13 +297,11 @@ m4_define([b4_public_types_define],
   // basic_symbol.
   template <typename Base>
   ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
-    : value ()
   {}
 
   template <typename Base>
   ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const 
basic_symbol& other)
-    : Base (other)
-    , value ()]b4_locations_if([
+    : Base (other)]b4_locations_if([
     , location (other.location)])[
   {
     ]b4_variant_if([b4_symbol_variant([other.type_get ()], [value], [copy],
@@ -331,8 +329,7 @@ m4_define([b4_public_types_define],
   ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
           [typename Base::kind_type t],
           b4_locations_if([const location_type& l]))[)
-    : Base (t)
-    , value ()]b4_locations_if([
+    : Base (t)]b4_locations_if([
     , location (l)])[
   {}]])[
 
diff --git a/data/stack.hh b/data/stack.hh
index b7196cf6..f3ac21f9 100644
--- a/data/stack.hh
+++ b/data/stack.hh
@@ -32,7 +32,6 @@ m4_define([b4_stack_define],
     typedef typename S::size_type size_type;
 
     stack ()
-      : seq_ ()
     {
       seq_.reserve (200);
     }
diff --git a/data/variant.hh b/data/variant.hh
index 41ed84ab..f3dee535 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -348,8 +348,8 @@ m4_define([b4_basic_symbol_constructor_define],
           [typename Base::kind_type t],
           b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]),
           b4_locations_if([const location_type& l]))[)
-    : Base (t)
-    , value (]b4_symbol_if([$1], [has_type], [v])[)]b4_locations_if([
+    : Base (t)]b4_symbol_if([$1], [has_type], [
+    , value (v)])[]b4_locations_if([
     , location (l)])[
   {}
 ]])




reply via email to

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