diff options
author | Ed Smith-Rowland <3dw4rd@verizon.net> | 2013-08-04 19:11:21 +0000 |
---|---|---|
committer | Edward Smith-Rowland <emsr@gcc.gnu.org> | 2013-08-04 19:11:21 +0000 |
commit | 65e5a578a8c9a1212ceb19ab0bf5d309465f1c5d (patch) | |
tree | 56a0abb03dfb98a5fea4ef57de64f000605935a0 /gcc/c-family | |
parent | 137a1a27e25efa3c13842c1c91a55947ed005412 (diff) | |
download | gcc-65e5a578a8c9a1212ceb19ab0bf5d309465f1c5d.zip gcc-65e5a578a8c9a1212ceb19ab0bf5d309465f1c5d.tar.gz gcc-65e5a578a8c9a1212ceb19ab0bf5d309465f1c5d.tar.bz2 |
re PR c++/58072 ([C++11] Error messages involving user-defined literals are poor (refer to tokens))
gcc/c-family:
2013-08-04 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/58072
* c-common.c (c_parse_error): Catch user-defined literal tokens and
provide useful error strings.
gcc/testsuite:
2013-08-04 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/58072
* g++.dg/cpp0x/pr58072.C: New.
From-SVN: r201475
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 019ee80..d8ca539 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2013-08-04 Ed Smith-Rowland <3dw4rd@verizon.net> + + PR c++/58072 + * c-common.c (c_parse_error): Catch user-defined literal tokens and + provide useful error strings. + 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net> * c-ada-spec.c (pp_ada_tree_identifier): Use specialized pretty diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 7bba376..2c806ab 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -9352,6 +9352,18 @@ c_parse_error (const char *gmsgid, enum cpp_ttype token_type, free (message); message = NULL; } + else if (token_type == CPP_CHAR_USERDEF + || token_type == CPP_WCHAR_USERDEF + || token_type == CPP_CHAR16_USERDEF + || token_type == CPP_CHAR32_USERDEF) + message = catenate_messages (gmsgid, + " before user-defined character literal"); + else if (token_type == CPP_STRING_USERDEF + || token_type == CPP_WSTRING_USERDEF + || token_type == CPP_STRING16_USERDEF + || token_type == CPP_STRING32_USERDEF + || token_type == CPP_UTF8STRING_USERDEF) + message = catenate_messages (gmsgid, " before user-defined string literal"); else if (token_type == CPP_STRING || token_type == CPP_WSTRING || token_type == CPP_STRING16 |