This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] pt.c: add missing %< and %>


This patch fixes some missing quoting of a source code element within
a diagnostic: a reference to "#include <initializer_list>".

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu;

Commited to trunk as r254281.

gcc/cp/ChangeLog:
	* pt.c (listify): Use %< and %> for description of #include.

gcc/testsuite/ChangeLog:
	* g++.dg/cpp0x/auto21.C: Update dg-error to reflect addition of
	quotes.
	* g++.dg/cpp0x/missing-initializer_list-include.C: Likewise.
---
 gcc/cp/pt.c                                                   | 2 +-
 gcc/testsuite/g++.dg/cpp0x/auto21.C                           | 2 +-
 gcc/testsuite/g++.dg/cpp0x/missing-initializer_list-include.C | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2642e57..55a11a7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -25133,7 +25133,7 @@ listify (tree arg)
       maybe_add_include_fixit (&richloc, "<initializer_list>");
       error_at (&richloc,
 		"deducing from brace-enclosed initializer list"
-		" requires #include <initializer_list>");
+		" requires %<#include <initializer_list>%>");
 
       return error_mark_node;
     }
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto21.C b/gcc/testsuite/g++.dg/cpp0x/auto21.C
index a827b3d..346e98c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto21.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto21.C
@@ -1,5 +1,5 @@
 // Origin PR c++/47208
 // { dg-do compile { target c++11 } }
 
-constexpr auto list = { }; // { dg-error "deducing from brace-enclosed initializer list requires #include <initializer_list>" }
+constexpr auto list = { }; // { dg-error "deducing from brace-enclosed initializer list requires '#include <initializer_list>'" }
 static const int l = list.size();
diff --git a/gcc/testsuite/g++.dg/cpp0x/missing-initializer_list-include.C b/gcc/testsuite/g++.dg/cpp0x/missing-initializer_list-include.C
index 8e803c8..7d72ec4 100644
--- a/gcc/testsuite/g++.dg/cpp0x/missing-initializer_list-include.C
+++ b/gcc/testsuite/g++.dg/cpp0x/missing-initializer_list-include.C
@@ -7,7 +7,7 @@
 
 void test (int i)
 {
-  auto a = { &i }; // { dg-error "deducing from brace-enclosed initializer list requires #include <initializer_list>" }
+  auto a = { &i }; // { dg-error "deducing from brace-enclosed initializer list requires '#include <initializer_list>'" }
 }
 
 /* Verify the output from -fdiagnostics-generate-patch.
-- 
1.8.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]