Commit 0ccb505d by Paolo Carlini Committed by Paolo Carlini

re PR c++/53210 (warning for data member initialized with itself should be in -Wall)

2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/53210
	* doc/invoke.texi ([Winit-self]): Document as enabled by -Wall
	in C++.

/c-family
2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/53210
	* c.opt ([Winit-self]): Enabled by -Wall in C++.

/cp
2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/53210
	* init.c (perform_member_init): Use OPT_Winit_self instead of
	OPT_Wuninitialized.

/testsuite
2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/53210
	* g++.dg/warn/Winit-self.C: New.

Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r191284
parent 03c432bd
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53210
* doc/invoke.texi ([Winit-self]): Document as enabled by -Wall
in C++.
2012-09-13 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/predicates.md (input_operand): Do not consider TImode
......
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53210
* c.opt ([Winit-self]): Enabled by -Wall in C++.
2012-08-23 Arnaud Charlet <charlet@adacore.com>
* c-ada-spec.c (dump_generic_ada_node): Fix handling of name_only
......
......@@ -408,7 +408,7 @@ C C++ Var(warn_ignored_qualifiers) Warning EnabledBy(Wextra)
Warn whenever type qualifiers are ignored.
Winit-self
C ObjC C++ ObjC++ Var(warn_init_self) Warning
C ObjC C++ ObjC++ Var(warn_init_self) Warning LangEnabledBy(C++ ObjC++,Wall)
Warn about variables which are initialized to themselves
Wimplicit
......
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53210
* init.c (perform_member_init): Use OPT_Winit_self instead of
OPT_Wuninitialized.
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (build_indirect_ref, build_function_call,
build_function_call_vec, build_binary_op, build_unary_op,
......
......@@ -578,7 +578,7 @@ perform_member_init (tree member, tree init)
if (TREE_CODE (val) == COMPONENT_REF && TREE_OPERAND (val, 1) == member
&& TREE_OPERAND (val, 0) == current_class_ref)
warning_at (DECL_SOURCE_LOCATION (current_function_decl),
OPT_Wuninitialized, "%qD is initialized with itself",
OPT_Winit_self, "%qD is initialized with itself",
member);
}
......
......@@ -3348,6 +3348,8 @@ int f()
@end group
@end smallexample
This warning is enabled by @option{-Wall} in C++.
@item -Wimplicit-int @r{(C and Objective-C only)}
@opindex Wimplicit-int
@opindex Wno-implicit-int
......
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53210
* g++.dg/warn/Wuninitialized-self.C: New.
2012-09-13 Jakub Jelinek <jakub@redhat.com>
PR c/54559
......
// PR c++/53210
// { dg-options "-Wall" }
struct S
{
S(int i) : j(j) { } // { dg-warning "is initialized with itself" }
int j;
};
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