aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-10-23 15:16:15 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-10-23 15:16:15 -0400
commit3f04b1bb6b124028008630fd791cdbd38925470c (patch)
tree2ecef8040634f68f3553aa4a7a369ebf89ad18b8 /gcc
parente28030cf01b290cd2cde25d7a68669e7ef5b7a43 (diff)
downloadgcc-3f04b1bb6b124028008630fd791cdbd38925470c.zip
gcc-3f04b1bb6b124028008630fd791cdbd38925470c.tar.gz
gcc-3f04b1bb6b124028008630fd791cdbd38925470c.tar.bz2
c-format.c (gcc_cxxdiag_char_table): Add %X.
c-family/ * c-format.c (gcc_cxxdiag_char_table): Add %X. cp/ * error.c (eh_spec_to_string): New. (cp_printer): Use it for %X. From-SVN: r203988
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c-format.c2
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/error.c14
4 files changed, 21 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 106bfa8..c7534b3 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-23 Jason Merrill <jason@redhat.com>
+
+ * c-format.c (gcc_cxxdiag_char_table): Add %X.
+
2013-10-11 Jakub Jelinek <jakub@redhat.com>
* c-common.h (omp_clause_mask::operator !=): New method.
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index c11d93a..f0371d3 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -721,7 +721,7 @@ static const format_char_info gcc_cxxdiag_char_table[] =
/* Custom conversion specifiers. */
/* These will require a "tree" at runtime. */
- { "ADEFKSTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL },
+ { "ADEFKSTVX",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL },
{ "v", 0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL },
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 99269af..78721a3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2013-10-23 Jason Merrill <jason@redhat.com>
+ * error.c (eh_spec_to_string): New.
+ (cp_printer): Use it for %X.
+
In C++11 a trivial [cd]tor might not be callable.
* class.c (user_provided_p): A function deleted on its declation
in the class is not user-provided.
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 3f6f594..5f997c3 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2998,6 +2998,15 @@ cv_to_string (tree p, int v)
return pp_ggc_formatted_text (cxx_pp);
}
+static const char *
+eh_spec_to_string (tree p, int /*v*/)
+{
+ int flags = 0;
+ reinit_cxx_pp ();
+ dump_exception_spec (cxx_pp, p, flags);
+ return pp_ggc_formatted_text (cxx_pp);
+}
+
/* Langhook for print_error_function. */
void
cxx_print_error_function (diagnostic_context *context, const char *file,
@@ -3379,8 +3388,10 @@ maybe_print_constexpr_context (diagnostic_context *context)
%O binary operator.
%P function parameter whose position is indicated by an integer.
%Q assignment operator.
+ %S substitution (template + args)
%T type.
- %V cv-qualifier. */
+ %V cv-qualifier.
+ %X exception-specification. */
static bool
cp_printer (pretty_printer *pp, text_info *text, const char *spec,
int precision, bool wide, bool set_locus, bool verbose)
@@ -3427,6 +3438,7 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec,
case 'S': result = subst_to_string (next_tree); break;
case 'T': result = type_to_string (next_tree, verbose); break;
case 'V': result = cv_to_string (next_tree, verbose); break;
+ case 'X': result = eh_spec_to_string (next_tree, verbose); break;
case 'K':
percent_K_format (text);