Commit 7dae2950 by Paolo Carlini Committed by Paolo Carlini

tree.c (handle_nodiscard_attribute): Improve warning location.

/cp
2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* tree.c (handle_nodiscard_attribute): Improve warning location.

/testsuite
2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp1z/nodiscard3.C: Test locations too.

From-SVN: r267547
parent d1409ea5
2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
* tree.c (handle_nodiscard_attribute): Improve warning location.
2019-01-02 Marek Polacek <polacek@redhat.com> 2019-01-02 Marek Polacek <polacek@redhat.com>
PR c++/88612 - ICE with -Waddress-of-packed-member. PR c++/88612 - ICE with -Waddress-of-packed-member.
......
...@@ -4372,8 +4372,9 @@ handle_nodiscard_attribute (tree *node, tree name, tree /*args*/, ...@@ -4372,8 +4372,9 @@ handle_nodiscard_attribute (tree *node, tree name, tree /*args*/,
if (TREE_CODE (*node) == FUNCTION_DECL) if (TREE_CODE (*node) == FUNCTION_DECL)
{ {
if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (*node)))) if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
warning (OPT_Wattributes, "%qE attribute applied to %qD with void " warning_at (DECL_SOURCE_LOCATION (*node),
"return type", name, *node); OPT_Wattributes, "%qE attribute applied to %qD with void "
"return type", name, *node);
} }
else if (OVERLOAD_TYPE_P (*node)) else if (OVERLOAD_TYPE_P (*node))
/* OK */; /* OK */;
......
2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp1z/nodiscard3.C: Test locations too.
2019-01-03 Martin Liska <mliska@suse.cz> 2019-01-03 Martin Liska <mliska@suse.cz>
PR testsuite/88436 PR testsuite/88436
...@@ -14,7 +18,7 @@ ...@@ -14,7 +18,7 @@
PR c++/81486 - CTAD failing with (). PR c++/81486 - CTAD failing with ().
* g++.dg/cpp1z/class-deduction60.C: New test. * g++.dg/cpp1z/class-deduction60.C: New test.
* g++.dg/cpp1z/class-deduction61.C: New test. * g++.dg/cpp1z/class-deduction61.C: New test.
2019-01-02 Martin Sebor <msebor@redhat.com> 2019-01-02 Martin Sebor <msebor@redhat.com>
Jeff Law <law@redhat.com> Jeff Law <law@redhat.com>
...@@ -31,7 +35,7 @@ ...@@ -31,7 +35,7 @@
messages only on vect_hw_misalign targets. messages only on vect_hw_misalign targets.
2019-01-02 Steven G. Kargl <kargl@gcc.gnu.org> 2019-01-02 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/argument_checking_7.f90: Remove run-on error message. * gfortran.dg/argument_checking_7.f90: Remove run-on error message.
* gfortran.dg/dec_d_lines_3.f: Ditto. * gfortran.dg/dec_d_lines_3.f: Ditto.
* gfortran.dg/dec_structure_24.f90: Ditto. * gfortran.dg/dec_structure_24.f90: Ditto.
......
...@@ -13,8 +13,8 @@ typedef struct { char big[1024]; fnt fn; } C; ...@@ -13,8 +13,8 @@ typedef struct { char big[1024]; fnt fn; } C;
struct [[nodiscard]] D { int i; D(); ~D(); }; struct [[nodiscard]] D { int i; D(); ~D(); };
WUR E check1 (void); WUR E check1 (void);
WUR void check2 (void); /* { dg-warning "nodiscard" } */ WUR void check2 (void); /* { dg-warning "10:.nodiscard." } */
WUR int foo; /* { dg-warning "nodiscard" } */ WUR int foo; /* { dg-warning "9:.nodiscard." } */
int bar (void); int bar (void);
WURAI E check3 (void) { return (E)bar (); } WURAI E check3 (void) { return (E)bar (); }
WUR A check4 (void); WUR A check4 (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment