From eff6739124c61bb5660d78453210d1d6a17d30e7 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 3 Nov 2018 08:48:48 +0100 Subject: 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::__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. --- examples/c++/variant.yy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') 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 -- cgit v1.2.1