summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2018-11-03 08:48:48 +0100
committerAkim Demaille <akim.demaille@gmail.com>2018-11-04 08:00:01 +0100
commiteff6739124c61bb5660d78453210d1d6a17d30e7 (patch)
tree0aa98693bf2f6ef1fc7f78d97fcb6e0072b51dfb /examples
parent5a0d7802f4c21ce72a92e56f84338240f34e7ec1 (diff)
downloadbison-eff6739124c61bb5660d78453210d1d6a17d30e7.tar.gz
c++: workaround portability issue
On some systems (x86_64-pc-solaris2.11), with Developer Studio 12.5's CC, we get: ".../include/CC/Cstd/vector.cc", line 127: Error: Cannot assign const yy::parser::stack_symbol_type to yy::parser::stack_symbol_type without "yy::parser::stack_symbol_type::operator=(const yy::parser::stack_symbol_type&)";. ".../include/CC/Cstd/vector", line 475: Where: While instantiating "std::vector<yy::parser::stack_symbol_type>::__insert_aux(yy::parser::stack_symbol_type*, const yy::parser::stack_symbol_type&)". ".../include/CC/Cstd/vector", line 475: Where: Instantiated from non-template code. 1 Error(s) detected. Don't expect __cplusplus to be always defined. If it's not, consider this is C++98. Reported by Nelson H. F. Beebe. * data/c++.m4, data/lalr1.cc, examples/c++/variant.yy, tests/local.at, * tests/testsuite.h: An undefined __cplusplus means pre C++11.
Diffstat (limited to 'examples')
-rw-r--r--examples/c++/variant.yy2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/c++/variant.yy b/examples/c++/variant.yy
index f77a746a..8fba6325 100644
--- a/examples/c++/variant.yy
+++ b/examples/c++/variant.yy
@@ -98,7 +98,7 @@ item:
namespace yy
{
// Use nullptr with pre-C++11.
-#if defined __cplusplus && __cplusplus < 201103L
+#if !defined __cplusplus || __cplusplus < 201103L
# define NULLPTR 0
#else
# define NULLPTR nullptr