aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/spew.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/spew.c')
-rw-r--r--gcc/cp/spew.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index adc3ffd40cf..5bd3fdf3d1b 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -1220,6 +1220,10 @@ snarf_method (decl)
DECL_PENDING_INLINE_INFO (decl) = meth;
DECL_PENDING_INLINE_P (decl) = 1;
+ /* We need to know that this was defined in the class, so that
+ friend templates are handled correctly. */
+ DECL_INITIALIZED_IN_CLASS_P (decl) = 1;
+
if (pending_inlines_tail)
pending_inlines_tail->next = meth;
else
@@ -1521,12 +1525,17 @@ yyerror (msgid)
error ("%s at end of input", string);
else if (last_token == CPP_CHAR || last_token == CPP_WCHAR)
{
- unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
- const char *const ell = (last_token == CPP_CHAR) ? "" : "L";
- if (val <= UCHAR_MAX && ISGRAPH (val))
- error ("%s before %s'%c'", string, ell, val);
+ if (yylval.ttype && TREE_CODE (yylval.ttype) == INTEGER_CST)
+ {
+ unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
+ const char *const ell = (last_token == CPP_CHAR) ? "" : "L";
+ if (val <= UCHAR_MAX && ISGRAPH (val))
+ error ("%s before %s'%c'", string, ell, val);
+ else
+ error ("%s before %s'\\x%x'", string, ell, val);
+ }
else
- error ("%s before %s'\\x%x'", string, ell, val);
+ error ("%s", string);
}
else if (last_token == CPP_STRING
|| last_token == CPP_WSTRING)