aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2019-05-21 23:11:26 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2019-05-21 23:11:26 +0000
commita2c67a8d7a1b28cafb45db034c55cfe96cf3ee9c (patch)
tree67b341e705318232e7328c817c590d3a52c30db3 /gcc/cp
parentcdb42a36a1ebe89a30389a3847bd8937e4b997e5 (diff)
downloadgcc-a2c67a8d7a1b28cafb45db034c55cfe96cf3ee9c.zip
gcc-a2c67a8d7a1b28cafb45db034c55cfe96cf3ee9c.tar.gz
gcc-a2c67a8d7a1b28cafb45db034c55cfe96cf3ee9c.tar.bz2
parser.c (cp_parser_template_declaration_after_parameters): Use DECL_SOURCE_LOCATION in literal operator template errors.
/cp 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com> * parser.c (cp_parser_template_declaration_after_parameters): Use DECL_SOURCE_LOCATION in literal operator template errors. /testsuite 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/udlit-tmpl-arg-neg2.C: Check locations too. * g++.dg/cpp0x/udlit-tmpl-parms-neg.C: Likewise. From-SVN: r271492
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e26cb98..970f7e8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
+ * parser.c (cp_parser_template_declaration_after_parameters): Use
+ DECL_SOURCE_LOCATION in literal operator template errors.
+
+2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 290f897..1440fdb 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -27895,14 +27895,16 @@ cp_parser_template_declaration_after_parameters (cp_parser* parser,
if (!ok)
{
if (cxx_dialect > cxx17)
- error ("literal operator template %qD has invalid parameter list;"
- " expected non-type template parameter pack %<<char...>%> "
- "or single non-type parameter of class type",
- decl);
+ error_at (DECL_SOURCE_LOCATION (decl), "literal operator "
+ "template %qD has invalid parameter list; expected "
+ "non-type template parameter pack %<<char...>%> or "
+ "single non-type parameter of class type",
+ decl);
else
- error ("literal operator template %qD has invalid parameter list;"
- " expected non-type template parameter pack %<<char...>%>",
- decl);
+ error_at (DECL_SOURCE_LOCATION (decl), "literal operator "
+ "template %qD has invalid parameter list; expected "
+ "non-type template parameter pack %<<char...>%>",
+ decl);
}
}