From 23d471c12af9afbc18cc9c42e6327754700ade08 Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 17 Mar 2013 02:35:01 +0000 Subject: PR c++/55017 * method.c (walk_field_subobs): Disallow copy of rvalue ref. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196728 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/method.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/cp/method.c') diff --git a/gcc/cp/method.c b/gcc/cp/method.c index ff29b596892..55c7e50d308 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1115,6 +1115,19 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk, "initialize %q+#D", field); } } + else if (sfk == sfk_copy_constructor) + { + /* 12.8p11b5 */ + if (TREE_CODE (mem_type) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (mem_type)) + { + if (diag) + error ("copying non-static data member %q#D of rvalue " + "reference type", field); + if (deleted_p) + *deleted_p = true; + } + } if (!CLASS_TYPE_P (mem_type)) continue; -- cgit v1.2.1 From d9d1b0a4878ce9d0e469ba5dfea170214c7c2023 Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 21 Mar 2013 17:36:47 +0000 Subject: PR middle-end/48087 * diagnostic.def (DK_WERROR): New kind. * diagnostic.h (werrorcount): Define. * diagnostic.c (diagnostic_report_diagnostic): For DK_WARNING promoted to DK_ERROR, increment DK_WERROR counter instead of DK_ERROR counter. * toplev.c (toplev_main): Call print_ignored_options even if just werrorcount is non-zero. Exit with FATAL_EXIT_CODE even if just werrorcount is non-zero. * pt.c (convert_nontype_argument): Count werrorcount as warnings. * call.c (build_temp): Likewise. * method.c (synthesize_method): Likewise. * typeck.c (convert_for_initialization): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196887 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/method.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cp/method.c') diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 55c7e50d308..316c5d3b8eb 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -755,7 +755,7 @@ synthesize_method (tree fndecl) tree stmt; location_t save_input_location = input_location; int error_count = errorcount; - int warning_count = warningcount; + int warning_count = warningcount + werrorcount; /* Reset the source location, we might have been previously deferred, and thus have saved where we were first needed. */ @@ -817,7 +817,7 @@ synthesize_method (tree fndecl) pop_deferring_access_checks (); - if (error_count != errorcount || warning_count != warningcount) + if (error_count != errorcount || warning_count != warningcount + werrorcount) inform (input_location, "synthesized method %qD first required here ", fndecl); } -- cgit v1.2.1