]> git.saurik.com Git - bison.git/blobdiff - tests/cxx-type.at
(ATTRIBUTE_UNUSED): Remove, since it infringes on
[bison.git] / tests / cxx-type.at
index 8650a5bd3314ec305b05079ac1343d8915bd75fa..e551ad019a54d5e67cc1a8ffb4ad756df45e96ef 100644 (file)
@@ -82,7 +82,7 @@ prog :
 
 stmt : expr ';'  $2    { $$ = ]$[1; }
      | decl      $3
-     | error ';'       { $$ = "<error>"; }
+     | error ';'       { static char error_msg[] = "<error>"; $$ = error_msg; }
      | '@'             { YYACCEPT; }
      ;
 
@@ -178,9 +178,10 @@ yylex (LEX_PARAMETERS)
              }
            else
              {
+               static char empty_string[] = "";
                colNum += 1;
                tok = c;
-               yylval = "";
+               yylval = empty_string;
              }
 #if YYLSP_NEEDED
            yylloc.last_column = colNum-1;
@@ -318,60 +319,60 @@ m4_define([_AT_VERBOSE_GLR_STDERR],
 AT_SETUP([GLR: Resolve ambiguity, impure, no locations])
 _AT_TEST_GLR_CXXTYPES([],
                       [%dprec 1], [%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, impure, locations])
 _AT_TEST_GLR_CXXTYPES([%locations],[%dprec 1],[%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, pure, no locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser],
                       [%dprec 1], [%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Resolve ambiguity, pure, locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser %locations],
                       [%dprec 1], [%dprec 2])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, impure, no locations])
 _AT_TEST_GLR_CXXTYPES([],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, impure, locations])
 _AT_TEST_GLR_CXXTYPES([%locations],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Merge conflicting parses, pure, no locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
 AT_CLEANUP
 AT_SETUP([GLR: Merge conflicting parses, pure, locations])
 _AT_TEST_GLR_CXXTYPES([%pure-parser %locations],
                       [%merge <stmtMerge>],[%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                 _AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
 AT_CLEANUP
 
 AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations])
 _AT_TEST_GLR_CXXTYPES([%error-verbose],
                       [%merge <stmtMerge>], [%merge <stmtMerge>])
-AT_PARSER_CHECK([[./types test-input | sed 's/  *$//']], 0,
+AT_PARSER_CHECK([[./types test-input]], 0,
                _AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
 AT_CLEANUP