diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-05-22 14:14:38 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-05-22 14:14:38 +0000 |
commit | 320d13eccc9e0df7e3ac2d9d81b8a56715c6c90e (patch) | |
tree | f5f13937652e0994395c48f4ff5c0482fd89c46f /gcc/cp | |
parent | effb52dae5203e21faf5f2c11bb0078e71f74482 (diff) | |
download | gcc-320d13eccc9e0df7e3ac2d9d81b8a56715c6c90e.zip gcc-320d13eccc9e0df7e3ac2d9d81b8a56715c6c90e.tar.gz gcc-320d13eccc9e0df7e3ac2d9d81b8a56715c6c90e.tar.bz2 |
re PR c++/65598 (Fix column location for 'explicit')
/cp
2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65598
* decl.c (grokdeclarator): Use the correct location in error
messages about 'explicit'.
/testsuite
2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65598
* g++.dg/cpp0x/explicit9.C: New.
* g++.dg/cpp0x/explicit8.C: Check the locations too.
From-SVN: r223576
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4dd8ec6..047b0a1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-05-22 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/65598 + * decl.c (grokdeclarator): Use the correct location in error + messages about 'explicit'. + 2015-05-22 Marek Polacek <polacek@redhat.com> Edward Smith-Rowland <3dw4rd@verizon.net> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 5396994..06fbbd5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10266,12 +10266,15 @@ grokdeclarator (const cp_declarator *declarator, in the declaration of a constructor or conversion function within a class definition. */ if (!current_class_type) - error ("%<explicit%> outside class declaration"); + error_at (declspecs->locations[ds_explicit], + "%<explicit%> outside class declaration"); else if (friendp) - error ("%<explicit%> in friend declaration"); + error_at (declspecs->locations[ds_explicit], + "%<explicit%> in friend declaration"); else - error ("only declarations of constructors and conversion operators " - "can be %<explicit%>"); + error_at (declspecs->locations[ds_explicit], + "only declarations of constructors and conversion operators " + "can be %<explicit%>"); explicitp = 0; } |