examples: clang 5 defines nullptr as a macro

* examples/variant.yy: So don't do it.
* examples/variant-11.yy: Fix comment.
This commit is contained in:
Akim Demaille
2018-10-22 18:27:27 +02:00
parent 121da2cbdb
commit 05d702422a
2 changed files with 6 additions and 3 deletions

View File

@@ -116,7 +116,8 @@ namespace yy
// TEXT "I have three numbers for you."
// NUMBER 1
// NUMBER 2
// NUMBER 3
// NUMBER ...
// NUMBER max - 1
// TEXT "And that's all!"
// END_OF_FILE

View File

@@ -99,7 +99,9 @@ namespace yy
{
// Use nullptr with pre-C++11.
#if defined __cplusplus && __cplusplus < 201103L
# define nullptr 0
# define NULLPTR 0
#else
# define NULLPTR nullptr
#endif
// The yylex function providing subsequent tokens:
@@ -117,7 +119,7 @@ namespace yy
static int count = 0;
const int stage = count;
++count;
parser::location_type loc (nullptr, unsigned (stage + 1), unsigned (stage + 1));
parser::location_type loc (NULLPTR, unsigned (stage + 1), unsigned (stage + 1));
switch (stage)
{
case 0: