+2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
+
+ * cp/init.c (perform_member_init): Homogenize uninitialized
+ diagnostics.
+
2014-04-01 Jason Merrill <jason@redhat.com>
PR c++/60708
2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52369
- * cp/method.c (walk_field_subobs): improve the diagnostic
+ * cp/method.c (walk_field_subobs): Improve the diagnostic
locations for both REFERENCE_TYPEs and non-static const members.
- * cp/init.c (diagnose_uninitialized_cst_or_ref_member): use %q#D
+ * cp/init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
instead of %qD to be consistent with the c++11 diagnostic.
2014-03-25 Jason Merrill <jason@redhat.com>
* g++spec.c (LIBSTDCXX_STATIC): New.
(lang_spec_driver): Use LIBSTDCXX_STATIC when not
shared_libgcc.
-
-2008-11-05 Fabien Chene <fabien.chene@gmail.com>
+
+2008-11-05 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/32519
* cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template
* typeck.c (cp_build_modify_expr): Complain about assignment to
array from init list.
-2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
+2010-05-10 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/43719
- * decl.c (check_initializer): strip array type before checking for
+ * decl.c (check_initializer): Strip array type before checking for
uninitialized const or ref members.
-2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
+2010-05-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/43951
* init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
PR c++/43779
* typeck.c (warn_args_num): New function.
(convert_arguments): Use warn_args_num to print the diagnostic
- messages.
+ messages.
-2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
+2010-04-29 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/43890
- * init.c (diagnose_uninitialized_cst_or_ref_member): check for
+ * init.c (diagnose_uninitialized_cst_or_ref_member): Check for
user-provided constructor while recursing.
2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
* init.c (perform_member_init): Check CLASS_TYPE_P.
-2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
+2010-04-27 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/29043
- * init.c (perform_member_init): check for uninitialized const or
+ * init.c (perform_member_init): Check for uninitialized const or
reference members, including array types.
2010-04-24 Jason Merrill <jason@redhat.com>
convert_like_real.
* cp-tree.h: Adjust.
-2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
+2010-04-27 Fabien Chêne <fabien@gcc.gnu.org>
Jason Merrill <jason@redhat.com>
PR c++/42844
* call.c (type_decays_to): Call cv_unqualified for non-class type.
-2010-04-12 Fabien Chene <fabien.chene@gmail.com>
+2010-04-12 Fabien Chêne <fabien@gcc.gnu.org>>
PR c++/25811
* cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2011-05-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/48859
- * init.c (diagnose_uninitialized_cst_or_ref_member_1): stop the
+ * init.c (diagnose_uninitialized_cst_or_ref_member_1): Stop the
recursion if there is user defined constructor.
2011-05-09 Jason Merrill <jason@redhat.com>
2012-02-16 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52126
- * decl.c (xref_basetypes): call dependent_scope_p instead of
+ * decl.c (xref_basetypes): Call dependent_scope_p instead of
dependent_type_p.
2012-02-16 Jason Merrill <jason@redhat.com>
if (CP_TYPE_CONST_P (type)
&& init == NULL_TREE
&& default_init_uninitialized_part (type))
- /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
- vtable; still give this diagnostic. */
- permerror (DECL_SOURCE_LOCATION (current_function_decl),
- "uninitialized member %qD with %<const%> type %qT",
- member, type);
+ {
+ /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
+ vtable; still give this diagnostic. */
+ if (permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "uninitialized const member in %q#T", type))
+ inform (DECL_SOURCE_LOCATION (member),
+ "%q#D should be initialized", member );
+ }
finish_expr_stmt (build_aggr_init (decl, init, flags,
tf_warning_or_error));
}
tree core_type;
/* member traversal: note it leaves init NULL */
if (TREE_CODE (type) == REFERENCE_TYPE)
- permerror (DECL_SOURCE_LOCATION (current_function_decl),
- "uninitialized reference member %qD",
- member);
+ {
+ if (permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "uninitialized reference member in %q#T", type))
+ inform (DECL_SOURCE_LOCATION (member),
+ "%q#D should be initialized", member);
+ }
else if (CP_TYPE_CONST_P (type))
- permerror (DECL_SOURCE_LOCATION (current_function_decl),
- "uninitialized member %qD with %<const%> type %qT",
- member, type);
+ {
+ if (permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "uninitialized const member in %q#T", type))
+ inform (DECL_SOURCE_LOCATION (member),
+ "%q#D should be initialized", member );
+ }
core_type = strip_array_types (type);
+2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
+
+ * g++.dg/init/ctor4.C: Adjust.
+ * g++.dg/init/ctor4-1.C: New.
+ * g++.dg/cpp0x/defaulted2.C: Adjust.
+
2014-04-01 Richard Henderson <rth@redhat.com>
PR target/60704
* gcc.dg/Warray-bounds-5.c: New test.
* gcc.dg/Warray-bounds-6.c: New test.
-2008-11-05 Fabien Chene <fabien.chene@gmail.com>
+2008-11-05 Fabien Chene <fabien@gcc.gnu.org>
PR c++/32519
* g++.dg/template/pr32519.C: New test.
* g++.dg/cpp0x/initlist26.C: Adjust.
* g++.dg/cpp0x/initlist28.C: Adjust.
-2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
+2010-05-10 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/43719
* g++.dg/init/pr43719.C: New.
* gnat.dg/sizetype3.ad[sb]: New test.
* gnat.dg/sizetype3_pkg.ads: New helper.
-2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
+2010-05-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/43951
* g++.dg/init/new29.C: New.
* gcc.dg/tree-ssa/builtin-free.c: New testcase.
-2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
-
- PR c++/43890
- * init.c (diagnose_uninitialized_cst_or_ref_member): check for
- user-provided constructor while recursing.
-
2010-04-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/42274
* g++.dg/template/pr23510.C: Update.
* lib/prune.exp: Filter out 'recursively instantiated'.
-2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
+2010-04-27 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/29043
* g++.dg/init/pr29043.C: New.
* g++.dg/template/sfinae17.C: New.
* g++.dg/template/sfinae18.C: New.
-2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
+2010-04-27 Fabien Chêne <fabien@gcc.gnu.org>
* g++.dg/init/pr42844.C: New.
* g++.dg/cpp0x/pr42844-2.C: New.
* g++.dg/cpp0x/lambda/lambda-conv4.C: New.
* g++.dg/cpp0x/lambda/lambda-deduce2.C: New.
-2010-04-12 Fabien Chene <fabien.chene@gmail.com>
+2010-04-12 Fabien Chene <fabien@gcc.gnu.org>
PR c++/25811
* g++.dg/init/pr25811.C: New test.
struct E
{
- const B b;
+ const B b; // { dg-message "should be initialized" }
E() { } // { dg-error "uninitialized" }
};
--- /dev/null
+// { dg-do compile }
+
+class foo {
+public:
+ foo();
+};
+
+class bar: public foo { // { dg-error "uninitialized" }
+ // { dg-message "implicitly deleted" "" { target c++11 } 8 }
+private:
+ int const a; // { dg-message "should be initialized" }
+};
+
+foo::foo() {
+}
+
+int main(int argc, char **argv)
+{
+ bar x; // { dg-error "deleted" "" { target c++11 } }
+ // { dg-message "synthesized" "" { target { ! c++11 } } 19 }
+}
foo();
};
-class bar: public foo { // { dg-error "reference|bar::bar" }
+class bar: public foo { // { dg-error "uninitialized" }
+ // { dg-message "implicitly deleted" "" { target c++11 } 9 }
private:
- int &a;
+ int &a; // { dg-message "should be initialized" }
};
foo::foo() {
int main(int argc, char **argv)
{
- bar x; // { dg-message "synthesized|deleted" }
+ bar x; // { dg-error "deleted" "" { target c++11 } }
+ // { dg-message "synthesized" "" { target { ! c++11 } } 20 }
}