--- gcc/cp/lex.c 2018/04/24 18:27:15 1.1.1.2 +++ gcc/cp/lex.c 2018/04/24 18:43:28 1.1.1.4 @@ -3313,6 +3313,14 @@ real_yylex () token_buffer[0] = '^'; token_buffer[1] = 0; } + else if (ptr->token == NAMESPACE) + { + static int warned; + if (! warned) + warning ("namespaces are mostly broken in this version of g++"); + + warned = 1; + } value = (int) ptr->token; } @@ -3373,7 +3381,12 @@ real_yylex () && DECL_INITIAL (tmp) != NULL_TREE && TREE_CODE (DECL_INITIAL (tmp)) == STRING_CST) { - yylval.ttype = DECL_INITIAL (tmp); + tree stringval = DECL_INITIAL (tmp); + + /* Copy the string value so that we won't clobber anything + if we put something in the TREE_CHAIN of this one. */ + yylval.ttype = build_string (TREE_STRING_LENGTH (stringval), + TREE_STRING_POINTER (stringval)); value = STRING; } }