X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/bc6038978f5fdd2c25bb30cc678811a26ad5a444..f6df83b4e80b2a53c08b5dc654e247076a3b9b03:/tests/c%20%20.at/bison.git/blobdiff_plain/bc6038978f5fdd2c25bb30cc678811a26ad5a444..f6df83b4e80b2a53c08b5dc654e247076a3b9b03:/tests/c++.at diff --git a/tests/c++.at b/tests/c++.at index 6b10f88c..a5d41a98 100644 --- a/tests/c++.at +++ b/tests/c++.at @@ -752,3 +752,46 @@ AT_PARSER_CHECK([[./input aaaaR]], [[0]]) AT_BISON_OPTION_POPDEFS AT_CLEANUP + +## ------------------------------------ ## +## C++ GLR parser identifier shadowing ## +## ------------------------------------ ## + +AT_SETUP([[C++ GLR parser identifier shadowing]]) + +AT_DATA_GRAMMAR([input.yy], [ +%skeleton "glr.cc" + +%union +{ + int ival; +} + +%token ZERO; + +%code +{ + int yylex (yy::parser::semantic_type *yylval); +} + +%% +exp: ZERO + +%% + +int yylex (yy::parser::semantic_type *yylval) +{ + return yy::parser::token::ZERO; +} + +void yy::parser::error (std::string const& msg) +{} + +int main() +{} +]) + +AT_BISON_CHECK([[-o input.cc input.yy]]) +AT_COMPILE_CXX([[input]]) + +AT_CLEANUP