From 2c75b081a0203f8b86d3c39092e03c4881584763 Mon Sep 17 00:00:00 2001 From: Kip Warner Date: Tue, 1 Aug 2017 17:58:44 -0700 Subject: [PATCH 1/2] C++11 thread_local keyword does not need to be prefixed within the std namespace. --- bisonc++/generator/polymorphic.cc | 2 +- bisonc++/generator/polymorphiccode.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bisonc++/generator/polymorphic.cc b/bisonc++/generator/polymorphic.cc index a491de69..be412018 100644 --- a/bisonc++/generator/polymorphic.cc +++ b/bisonc++/generator/polymorphic.cc @@ -23,7 +23,7 @@ void Generator::polymorphic(ostream &out) const "extern "; if (d_threadSafe) - out << "std::thread_local "; + out << "thread_local "; out << "size_t const *t_nErrors;\n"; diff --git a/bisonc++/generator/polymorphiccode.cc b/bisonc++/generator/polymorphiccode.cc index a1aa13b4..52ff4546 100644 --- a/bisonc++/generator/polymorphiccode.cc +++ b/bisonc++/generator/polymorphiccode.cc @@ -33,7 +33,7 @@ void Generator::polymorphicCode(ostream &out) const "\n"; if (d_threadSafe) - out << "std::thread_local "; + out << "thread_local "; out << "size_t const *t_nErrors;\n"; From f7a756a1e8cbf4a59a563f87e3565960d7742605 Mon Sep 17 00:00:00 2001 From: Kip Warner Date: Tue, 1 Aug 2017 18:16:33 -0700 Subject: [PATCH 2/2] Polymorphic generated code's Semantic class's copy constructor needs to explicitly invoke the base default constructor or will generate a compiler error with gcc. --- bisonc++/skeletons/bisonc++polymorphic | 1 + 1 file changed, 1 insertion(+) diff --git a/bisonc++/skeletons/bisonc++polymorphic b/bisonc++/skeletons/bisonc++polymorphic index ca12f174..272355c8 100644 --- a/bisonc++/skeletons/bisonc++polymorphic +++ b/bisonc++/skeletons/bisonc++polymorphic @@ -79,6 +79,7 @@ Semantic::Semantic() template Semantic::Semantic(Semantic const &other) : + Base(), d_data(other.d_data) { d_baseTag = other.d_baseTag;