summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/warn
Commit message (Collapse)AuthorAgeFilesLines
* PR c++/61465jason2014-09-221-0/+8
| | | | | | | * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use after pulling out an element from a CONSTRUCTOR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@215476 138bc75d-0d04-0410-961f-82ee72b054a4
* * doc/invoke (Wnon-virtual-dtor): Update to match implementation.nathan2014-04-083-3/+60
| | | | | | | | | | | | | | | | | (Weffc++): Likewise. cp/ * class.c (check_bases_and_members): Warn about non-virtual dtors in public bases only. Check warn_ecpp before complaining about non-polymorphic bases. testsuite/ * g++.dg/warn/Wnvdtor-2.C: Add more cases. * g++.dg/warn/Wnvdtor-3.C: Likewise. * g++.dg/warn/Wnvdtor-4.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209212 138bc75d-0d04-0410-961f-82ee72b054a4
* * doc/invoke.texi (Wnon-virtual-dtor): Adjust documentation.nathan2014-04-035-9/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | (Weffc++): Remove Scott's numbering, merge lists and reference Wnon-virtual-dtor. c-family/ * c.opt (Wnon-virtual-dtor): Auto set when Weffc++. cp/ * class.c (accessible_nvdtor_p): New. (check_bases): Don't check base destructor here ... (check_bases_and_members): ... check them here. Trigger on Wnon-virtual-dtor flag. (finish_struct_1): Use accessible_nvdtor_p. testsuite/ * g++.dg/warn/Wnvdtor.C: Add non-polymorphic case. * g++.dg/warn/Wnvdtor-2.C: New. * g++.dg/warn/Wnvdtor-3.C: New. * g++.dg/warn/Wnvdtor-4.C: New. * g++.dg/warn/Weff1.C: Delete. * g++.old-deja/g++.benjamin/15309-1.C: Delete. * g++.old-deja/g++.benjamin/15309-2.C: Delete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209056 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/44859jason2014-04-011-0/+11
| | | | | | | * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap COMPONENT_REFs and ARRAY_REFs sooner. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208970 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/53711jason2014-03-141-0/+8
| | | | | | * d++.dg/warn/anonymous-namespace-6.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208569 138bc75d-0d04-0410-961f-82ee72b054a4
* * lib/g++-dg.exp (g++-dg-runtest): Run tests in C++1y mode, too.jason2014-03-0710-16/+17
| | | | | | | | | | | | | | * lib/target-supports.exp (check_effective_target_c++11): Now means C++11 and up. (check_effective_target_c++11_only): New. (check_effective_target_c++11_down): New. (check_effective_target_c++1y): New. (check_effective_target_c++1y_only): New. (check_effective_target_c++98_only): Rename from check_effective_target_c++98. * g++.dg/*: Use { target c++11 } instead of -std=c++11. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208416 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/59231jason2014-02-261-0/+18
| | | | | | | | | | | | | | | PR c++/11586 PR c++/14710 PR c++/57132 gcc/ * c-common.c (shorten_compare): Don't check c_inhibit_evaluation_warnings. gcc/cp/ * pt.c (struct warning_sentinel): New. (tsubst_copy_and_build): Use it instead of c_inhibit_evaluation_warnings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208183 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/59916jason2014-01-291-0/+13
| | | | | | | * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for cdtor_returns_this case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207271 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/59315jason2014-01-291-1/+1
| | | | | | * decl.c (cxx_maybe_build_cleanup): Call mark_used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207236 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/55189jason2014-01-231-0/+60
| | | | | | | | | | | | | | | | | * cp-tree.h (struct language_function): Add infinite_loop and infinite_loops. (current_function_infinite_loop): New. * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop) (break_maybe_infinite_loop): New. (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt) (finish_do_stmt, finish_for_cond, finish_for_stmt) (begin_range_for_stmt): Use them. * decl.c (finish_function): Don't warn about missing return if current_function_infinite_loop. * pt.c (instantiate_decl): Copy current_function_infinite_loop. * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207001 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-12-05 Paolo Carlini <paolo.carlini@oracle.com>paolo2013-12-051-1/+1
| | | | | | | * g++.dg/warn/pr15774-1.C: Adjust expected message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205722 138bc75d-0d04-0410-961f-82ee72b054a4
* libcpp/burnus2013-11-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2013-11-06 Tobias Burnus <burnus@net-b.de> * macro.c (_cpp_builtin_macro_text): Correct wording of two warnings. gcc/c-family/ 2013-11-06 Tobias Burnus <burnus@net-b.de> * c-common.c (reason_option_codes_t): Add CPP_W_DATE_TIME. gcc/ 2013-11-06 Tobias Burnus <burnus@net-b.de> * doc/invoke.texi (Wdate-time): Fix typo. gcc/testsuite/ 2013-11-06 Tobias Burnus <burnus@net-b.de> * g++.dg/warn/wdate-time.C: Update dg-error pattern. * gcc.dg/wdate-time.c: Ditto. * gfortran.dg/wdate-time.F90: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204486 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-11-05 Tobias Burnus <burnus@net-b.de>burnus2013-11-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/c-family/ * c.opt (-Wdate-time): New option * c-opts.c (sanitize_cpp_opts): Pass on to libcpp. gcc/ * doc/invoke.texi (-Wdate-time): Document. gcc/fortran * lang.opt (-Wdate-time): New option * cpp.c (gfc_cpp_option_data): Add warn_date_time. (gfc_cpp_init_options, gfc_cpp_handle_option, gfc_cpp_post_options): Handle it and pass on to libcpp. gcc/testsuite/ * g++.dg/warn/wdate-time.C: New. * gcc.dg/wdate-time.c: New. * gfortran.dg/wdate-time.F90: New. libcpp/ * include/cpplib.h (CPP_W_DATE_TIME): Added. (cpp_options): Add warn_date_time. * init.c (cpp_create_reader): Init it. * macro.c (_cpp_builtin_macro_text): Warn when __DATE__/__TIME__/__TIMESTAMP__ is used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204420 138bc75d-0d04-0410-961f-82ee72b054a4
* * gimple-pretty-print.c (dump_ssaname_info): Print newline alsojakub2013-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | in case of VR_VARYING. Print get_nonzero_bits if not all ones. * tree-ssanames.h (struct range_info_def): Add nonzero_bits field. (set_nonzero_bits, get_nonzero_bits): New prototypes. * tree-ssa-ccp.c (get_default_value): Use get_range_info to see if a default def isn't partially constant. (ccp_finalize): If after IPA, set_range_info if integral SSA_NAME is known to be partially zero. (evaluate_stmt): If we'd return otherwise VARYING, use get_range_info to see if a default def isn't partially constant. * tree-ssanames.c (set_range_info): Initialize nonzero_bits upon creation of a range, if VR_RANGE, try to improve nonzero_bits from the range. (set_nonzero_bits, get_nonzero_bits): New functions. * g++.dg/warn/pr33738.C (main): Initialize a2 again to make sure we warn about it already during VRP1 pass. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204256 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/58325jakub2013-09-091-0/+31
| | | | | | | | | * init.c (build_vec_delete): Call mark_rvalue_use on base. * g++.dg/warn/Wunused-var-21.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202411 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>paolo2013-09-092-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/43452 * doc/invoke.texi (-Wdelete-incomplete): Document it. /c-family 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/43452 * c.opt (Wdelete-incomplete): Add. /cp 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/43452 * init.c (build_vec_delete_1): When the type is incomplete emit a warning, enabled by default (not an error). (build_delete): Adjust to use OPT_Wdelete_incomplete. /testsuite 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/43452 * g++.dg/warn/Wdelete-incomplete-1.C: New. * g++.dg/warn/Wdelete-incomplete-2.C: Likewise. * g++.dg/init/delete1.C: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202404 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-09-091-0/+14
| | | | | | | | | | | | | | | | 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58362 * error.c (location_of): Don't handle PARM_DECLs specially. /testsuite 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58362 * g++.dg/warn/Wunused-parm-5.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202402 138bc75d-0d04-0410-961f-82ee72b054a4
* * g++.dg/warn/weak1.C: Skip on AIX.dje2013-09-041-0/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202263 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-09-041-0/+15
| | | | | | | | | | | | | | | | 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58305 * typeck2.c (build_functional_cast): Maybe warn_deprecated_use. /testsuite 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58305 * g++.dg/warn/deprecated-8.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202242 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>paolo2013-08-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | * call.c (build_new_method_call_1): Use INDIRECT_REF_P. * cp-tree.h (REFERENCE_REF_P): Likewise. * semantics.c (finish_offsetof): Likewise. /cp 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56130 * semantics.c (finish_id_expression): Handle deprecated references. /testsuite 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56130 * g++.dg/warn/deprecated-7.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201906 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>paolo2013-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config/i386/i386.c (ix86_function_versions): Use error + inform. /cp 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (warn_extern_redeclared_static, duplicate_decls, check_elaborated_type_specifier): Use error + inform. * friend.c (make_friend_class): Likewise. * semantics.c (finish_id_expression): Likewise. /testsuite 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/constexpr-function2.C: Adjust for error -> inform changes. * g++.dg/cpp0x/constexpr-neg1.C: Likewise. * g++.dg/cpp0x/defaulted2.C: Likewise. * g++.dg/cpp0x/defaulted31.C: Likewise. * g++.dg/cpp0x/error6.C: Likewise. * g++.dg/cpp0x/gen-attrs-32.C: Likewise. * g++.dg/cpp0x/override2.C: Likewise. * g++.dg/cpp0x/parse1.C: Likewise. * g++.dg/cpp0x/scoped_enum.C: Likewise. * g++.dg/cpp0x/temp_default4.C: Likewise. * g++.dg/ext/attrib32.C: Likewise. * g++.dg/ext/gnu-inline-global-reject.C: Likewise. * g++.dg/ext/mv13.C: Likewise. * g++.dg/ext/mv7.C: Likewise. * g++.dg/ext/mv9.C: Likewise. * g++.dg/ext/pr57362.C: Likewise. * g++.dg/ext/typeof10.C: Likewise. * g++.dg/lookup/anon6.C: Likewise. * g++.dg/lookup/crash6.C: Likewise. * g++.dg/lookup/name-clash5.C: Likewise. * g++.dg/lookup/name-clash6.C: Likewise. * g++.dg/other/anon4.C: Likewise. * g++.dg/other/error15.C: Likewise. * g++.dg/other/error8.C: Likewise. * g++.dg/other/redecl2.C: Likewise. * g++.dg/parse/crash16.C: Likewise. * g++.dg/parse/crash21.C: Likewise. * g++.dg/parse/crash38.C: Likewise. * g++.dg/parse/redef2.C: Likewise. * g++.dg/parse/struct-as-enum1.C: Likewise. * g++.dg/template/crash39.C: Likewise. * g++.dg/template/redecl3.C: Likewise. * g++.dg/tls/diag-3.C: Likewise. * g++.dg/warn/Wredundant-decls-spec.C: Likewise. * g++.old-deja/g++.benjamin/typedef01.C: Likewise. * g++.old-deja/g++.benjamin/warn02.C: Likewise. * g++.old-deja/g++.brendan/crash16.C: Likewise. * g++.old-deja/g++.brendan/crash18.C: Likewise. * g++.old-deja/g++.brendan/err-msg4.C: Likewise. * g++.old-deja/g++.brendan/redecl1.C: Likewise. * g++.old-deja/g++.brendan/static3.C: Likewise. * g++.old-deja/g++.bugs/900127_02.C: Likewise. * g++.old-deja/g++.jason/binding.C: Likewise. * g++.old-deja/g++.jason/crash4.C: Likewise. * g++.old-deja/g++.jason/crash7.C: Likewise. * g++.old-deja/g++.jason/lineno.C: Likewise. * g++.old-deja/g++.jason/scoping7.C: Likewise. * g++.old-deja/g++.mike/misc3.C: Likewise. * g++.old-deja/g++.mike/net44.C: Likewise. * g++.old-deja/g++.mike/ns3.C: Likewise. * g++.old-deja/g++.ns/alias4.C: Likewise. * g++.old-deja/g++.ns/ns11.C: Likewise. * g++.old-deja/g++.other/crash23.C: Likewise. * g++.old-deja/g++.other/decl8.C: Likewise. * g++.old-deja/g++.other/linkage3.C: Likewise. * g++.old-deja/g++.other/typeck1.C: Likewise. * g++.old-deja/g++.other/typedef5.C: Likewise. * g++.old-deja/g++.pt/explicit34.C: Likewise. * g++.old-deja/g++.pt/friend36.C: Likewise. * obj-c++.dg/method-8.mm: Likewise. * obj-c++.dg/tls/diag-3.mm: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201671 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/55203jason2013-07-131-0/+22
| | | | | | | | | | | c-family/ * c-common.c (c_common_attribute_table): Add warn_unused. (handle_warn_unused_attribute): New. cp/ * init.c (build_aggr_init): Check for warn_unused attribute. * decl.c (poplevel): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200941 138bc75d-0d04-0410-961f-82ee72b054a4
* /c-familypaolo2013-07-101-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57869 * c.opt: Add Wconditionally-supported. /cp 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57869 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported warn about casting between pointer-to-function and pointer-to-object. /gcc 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57869 * doc/invoke.texi: Document -Wconditionally-supported. /testsuite 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57869 * g++.dg/cpp0x/reinterpret_cast1.C: New. * g++.dg/warn/Wconditionally-supported-1.C: Likewise. * g++.dg/conversion/dr195.C: Update. * g++.dg/expr/cast2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200876 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-06-121-0/+19
| | | | | | | | | | | | | | | | | 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/38958 * decl.c (poplevel): For the benefit of -Wunused-variable see through references. /testsuite 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/38958 * g++.dg/warn/Wunused-var-20.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200042 138bc75d-0d04-0410-961f-82ee72b054a4
* * name-lookup.c (add_decl_to_level): Add decls in an anonymousjason2013-06-101-0/+8
| | | | | | namespace to static_decls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199906 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-05-211-12/+12
| | | | | | | | | | | | | | | | | | | | | 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com> * call.c (build_conditional_expr_1): Add location_t parameter. (build_conditional_expr): Likewise. * typeck.c (rationalize_conditional_expr, cp_build_array_ref, get_member_function_from_ptrfunc, build_x_conditional_expr, cp_build_modify_expr): Update. * init.c (build_new_1): Likewise. * cp-tree.h: Update declaration. /testsuite 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/explicit3.C: Add column in dg-error strings. * g++.dg/warn/Wdouble-promotion.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199166 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-05-202-2/+16
| | | | | | | | | | | | | | | | | 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/23608 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op. /testsuite 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/23608 * g++.dg/warn/Wsign-compare-6.C: New. * g++.dg/warn/Wdouble-promotion.C: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199102 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/57317jason2013-05-202-0/+26
| | | | | | | * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide whether a template has its own args. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199101 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-05-153-14/+14
| | | | | | | | | | | | | | | | | | | | 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com> * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of warning_at and permerror with warning_at/inform and permerror/ inform, respectively. /testsuite 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/lambda/lambda-shadow1.C: Replace dg-warnings with dg-messages. * g++.dg/warn/Wshadow-1.C: Likewise. * g++.dg/warn/Wshadow-6.C: Likewise. * g++.dg/warn/Wshadow-7.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198943 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-05-011-0/+18
| | | | | | | | | | | | | | | | | 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57132 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease c_inhibit_evaluation_warnings around build_x_modify_expr call. /testsuite 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57132 * g++.dg/warn/Wdiv-by-zero-bogus-2.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198504 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2013-04-031-0/+13
| | | | | | | | | | | | | | | | | | 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56815 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to pedwarn. /testsuite 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56815 * g++.dg/warn/Wpointer-arith-1.C: New. * g++.dg/gomp/for-19.C: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197433 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/56607jakub2013-03-161-0/+34
| | | | | | | | | | | * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero, pass op1 through maybe_constant_value first. * g++.dg/warn/Wdiv-by-zero-2.C: New test. * c-c++-common/pr56607.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196704 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-03-05 Paolo Carlini <paolo.carlini@oracle.com>paolo2013-03-051-0/+11
| | | | | | | | PR c++/56530 * g++.dg/warn/Wsign-conversion-2.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196460 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-02-21 Richard Biener <rguenther@suse.de>rguenth2013-02-211-30/+0
| | | | | | | | | | | | | | | | | | | | PR tree-optimization/56415 Revert 2013-02-11 Richard Biener <rguenther@suse.de> PR tree-optimization/56273 * tree-vrp.c (simplify_cond_using_ranges): Disable for the first VRP run. * g++.dg/warn/Warray-bounds-6.C: New testcase. * gcc.dg/tree-ssa/pr21559.c: Adjust. * gcc.dg/tree-ssa/vrp17.c: Likewise. * gcc.dg/tree-ssa/vrp18.c: Likewise. * gcc.dg/tree-ssa/vrp23.c: Likewise. * gcc.dg/tree-ssa/vrp24.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196200 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-02-11 Richard Biener <rguenther@suse.de>rguenth2013-02-111-0/+30
| | | | | | | | | | | | | | | | | | PR tree-optimization/56273 * tree-vrp.c (simplify_cond_using_ranges): Disable for the first VRP run. (check_array_ref): Fix missing newline in dumps. (search_for_addr_array): Likewise. * g++.dg/warn/Warray-bounds-6.C: New testcase. * gcc.dg/tree-ssa/pr21559.c: Adjust. * gcc.dg/tree-ssa/vrp17.c: Likewise. * gcc.dg/tree-ssa/vrp18.c: Likewise. * gcc.dg/tree-ssa/vrp23.c: Likewise. * gcc.dg/tree-ssa/vrp24.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195940 138bc75d-0d04-0410-961f-82ee72b054a4
* remove unnecessary bits from g++.dg/warn/pmf2.Cjason2013-01-251-2/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195477 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/56104jason2013-01-251-0/+24
| | | | | | | * typeck.c (get_member_function_from_ptrfunc): Optimize if the dynamic type has no virtual functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195470 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/55643jakub2012-12-111-0/+26
| | | | | | | | | * expr.c (mark_exp_read): Handle FLOAT_EXPR similarly to NOP_EXPR. * g++.dg/warn/Wunused-var-19.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194415 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/54046jakub2012-11-231-0/+90
| | | | | | | | | | | | | | | | | | | | * Makefile.in (gimple-low.o): Depend on langhooks.h. * gimple-low.c: Include langhooks.c. (block_may_fallthru): Handle TARGET_EXPR and ERROR_MARK, by default call lang_hooks.block_may_fallthru. * langhooks.h (struct lang_hooks): Add block_may_fallthru langhook. * langhooks-def.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define. (LANG_HOOKS_INITIALIZER): Use it. * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine. * cp-objcp-common.c (cxx_block_may_fallthru): New function. * cp-tree.h (cxx_block_may_fallthru): New prototype. * g++.dg/warn/Wreturn-type-8.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193762 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/c-family:redi2012-10-292-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/54930 * c.opt (Wreturn_local_addr): Define new option. gcc/c: PR c++/54930 * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr. gcc/cp: PR c++/54930 * typeck.c (maybe_warn_about_returning_address_of_local): Use OPT_Wreturn_local_addr. gcc: PR c++/54930 * doc/invoke.texi (Warning Options): Document -Wno-return-local-addr. gcc/testsuite: PR c++/54930 * gcc.dg/Wreturn-local-addr.c: New. * g++.dg/warn/Wno-return-local-addr.C: New. * g++.dg/warn/Wreturn-local-addr.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192968 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com>paolo2012-10-092-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/54194 * tree.h: Add EXPR_LOC_OR_LOC. c-family/ 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54194 * c-common.c (warn_about_parentheses): Add location_t parameter; use EXPR_LOC_OR_LOC. * c-common.h: Update declaration. c/ 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54194 * c-typeck.c (parser_build_binary_op): Update warn_about_parentheses call. /cp 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54194 * typeck.c (build_x_binary_op): Update warn_about_parentheses call. * parser.c (cp_parser_binary_expression): Use SET_EXPR_LOCATION on current.lhs. /testsuite 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54194 * g++.dg/warn/Wparentheses-26.C: Adjust. * g++.dg/warn/Wparentheses-27.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192246 138bc75d-0d04-0410-961f-82ee72b054a4
* cp/jakub2012-10-053-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define. * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with SIZEOF_EXPR_TYPE_P. * mangle.c (write_expression): Likewise. * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise. * error.c (dump_expr): Likewise. * parser.c (cp_parser_unary_expression): For sizeof call cxx_sizeof_or_alignof_{type,expr} just for diagnostics and return SIZEOF_EXPR with the operand. * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR, call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but return SIZEOF_EXPR with tsubsted operand. (value_dependent_expression_p): Handle SIZEOF_EXPR with SIZEOF_EXPR_TYPE_P. (instantiation_dependent_r): Likewise. * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98. * semantics.c (finish_call_expr): Call sizeof_pointer_memaccess_warning if needed. (cxx_eval_constant_expression): Handle SIZEOF_EXPR. (potential_constant_expression_1): Remove early exit for C++98. Handle PROPERTY_REF. * decl.c (duplicate_decls): When redeclaring a builtin function, keep the merged decl builtin also if newdecl is a gnu_inline inline definition. (fold_sizeof_expr_r): New function. (compute_array_index_type): Fold SIZEOF_EXPRs in itype. * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR. * typeck.c (cp_build_binary_op): For warn_for_sign_compare try harder using maybe_constant_value to get INTEGER_CSTs. * decl.c (stabilize_vla_size): Call pointer_set_destroy at the end. testsuite/ * g++.dg/torture/Wsizeof-pointer-memaccess1.C: New test. * g++.dg/torture/Wsizeof-pointer-memaccess2.C: New test. * g++.dg/warn/Wsign-compare-5.C: New test. * g++.dg/warn/Wsizeof-pointer-memaccess-1.C: New test. * g++.dg/warn/Wnull-conversion-1.C: For c++11 add dg-error. * g++.dg/ext/builtin30.C: New test. * g++.dg/ext/vla12.C: New test. * gcc.dg/builtins-85.c: New test. libstdc++-v3/ * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192141 138bc75d-0d04-0410-961f-82ee72b054a4
* Move testsuite/c-c++-common/Wunused-local-typedefs-2.c to ↵dodji2012-09-281-0/+35
| | | | | | | | | | | testsuite/g++.dg/warn/Wunused-local-typedefs-3.C gcc/testsuite/ * g++.dg/warn/Wunused-local-typedefs-3.C: Move the c++-only test gcc/testsuite/c-c++-common/Wunused-local-typedefs-2.c to here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191832 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/29028 - Missed unused warning on using declarationdodji2012-09-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | In the example of the patch, g++ fails to warn that the variable N::i (introduced via a using declaration) is unused. This is because as we want to emit the warning in poplevel, when we walk the local bindings returned by getdecls, we forget that a VAR_DECL introduced by a using declaration is represented by a TREE_LIST which TREE_VALUE is the VAR_DECL, and we wrongly look for a bare VAR_DECL. Fixed thus and tested on x86_64-unknown-linux-gnu against trunk. gcc/cp/ * decl.c (poplevel<warn_unused*>): Do not forget that some local bindings are represented by a TREE_LIST. gcc/testsuite/ * g++.dg/warn/Wunused-var-18.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191829 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/53551 - -Wunused-local-typedefs misses usesdodji2012-09-281-0/+20
| | | | | | | | | | | | | | | | | We don't record the use of a typedef when it's used through a typename. Fixed thus. Tested on x86_64-unknown-linux-gnu against trunk. gcc/cp/ * decl.c (make_typename_type): Record the use of typedefs. gcc/testsuite/ * g++.dg/warn/Wunused-local-typedefs-2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191828 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>paolo2012-09-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191284 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2012-08-201-0/+4
| | | | | | | | | | | | | | | | | 2012-08-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/10416 * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for Wunused_variable too. /testsuite 2012-08-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/10416 * g++.dg/warn/Wunused-var-17.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190538 138bc75d-0d04-0410-961f-82ee72b054a4
* * g++.dg/cpp0x/auto27.C: Add comments to checks for multiplejanis2012-06-153-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | messages reported for one line of source code. * g++.dg/cpp0x/constexpr-decl.C: Likewise. * g++.dg/cpp0x/decltype2.C: Likewise. * g++.dg/cpp0x/decltype3.C: Likewise. * g++.dg/cpp0x/lambda/lambda-syntax1.C: Likewise. * g++.dg/cpp0x/regress/error-recovery1.C: Likewise. * g++.dg/cpp0x/static_assert3.C: Likewise. * g++.dg/cpp0x/udlit-cpp98-neg.C: Likewise. * g++.dg/cpp0x/udlit-shadow-neg.C: Likewise. * g++.dg/cpp0x/union1.C: Likewise. * g++.dg/cpp0x/variadic-ex10.C: Likewise. * g++.dg/cpp0x/variadic-ex14.C: Likewise. * g++.dg/cpp0x/variadic2.C: Likewise. * g++.dg/cpp0x/variadic20.C: Likewise. * g++.dg/cpp0x/variadic74.C: Likewise. * g++.dg/diagnostic/bitfld2.C: Likewise. * g++.dg/ext/attrib44.C: Likewise. * g++.dg/ext/no-asm-1.C: Likewise. * g++.dg/other/error34.C: Likewise. * g++.dg/parse/crash46.C: Likewise. * g++.dg/parse/error10.C: Likewise. * g++.dg/parse/error2.C: Likewise. * g++.dg/parse/error3.C: Likewise. * g++.dg/parse/error36.C: Likewise. * g++.dg/parse/error8.C: Likewise. * g++.dg/parse/error9.C: Likewise. * g++.dg/parse/parser-pr28152-2.C: Likewise. * g++.dg/parse/parser-pr28152.C: Likewise. * g++.dg/parse/template25.C: Likewise. * g++.dg/parse/typename11.C: Likewise. * g++.dg/tc1/dr147.C: Likewise. * g++.dg/template/deduce3.C: Likewise. * g++.dg/template/koenig9.C: Likewise. * g++.dg/template/pr23510.C: Likewise. * g++.dg/warn/pr12242.C: Likewise. * g++.dg/warn/pr30551-2.C: Likewise. * g++.dg/warn/pr30551.C: Likewise. * g++.old-deja/g++.other/typename1.C: Likewise. * g++.old-deja/g++.pt/niklas01a.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188677 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>paolo2012-06-041-0/+31
| | | | | | | | | | | | | | | | | | | | | PR c++/53524 * doc/invoke.texi (Wenum-compare): Update documentation. /cp 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53524 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare to control enumeral mismatch in conditional expression too. /testsuite 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53524 * g++.dg/warn/Wenum-compare-no-2: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188204 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/53463 - Fix system header detection for built-in macro tokensdodji2012-06-042-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location for a built-in macro token is BUILTIN_LOCATION. When we see that location value, we cannot know if that token was used in a system header or not. And that can trigger some unwanted warnings on e.g, the use of __LONG_LONG_MAX__ built-in macro in system headers when we compile with -pedantic, like in the test case accompanying this patch. In that case, I think we ought to step-up to see where the built-in macro has been expanded, until we see a location that is not for a built-in macro. Then we can check if the resulting location is in a system header or not. Now that we step up to the location of first non-built-in-macro token, it appeared that for testsuite/c-c++-common/dfp/convert-int-saturate.c, G++ then fails to emit the warning in: volatile unsigned int usi; int main () { usi = DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ ... } Because DEC32_MAX is defined in the system header float.h as a built-in macro: #define DEC32_MAX __DEC32_MAX__ And during the parsing of the assignment expression that should have led to the warning above, input_location is set to the location for the DEC32_MAX, which is actually the location for the built-in __DECL32_MAX_EXP. A possible fix is to use the location of the "=" operator as the default location for assignment expressions. This is what the patch does. I had to adjust a couple of tests to arrange for this. Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. libcpp/ PR preprocessor/53463 * line-map.c (linemap_location_in_system_header_p): For built-in macro tokens, check the first expansion point location for that is not for a token coming from a built-in macro. gcc/cp/ PR preprocessor/53463 * parser.c (cp_parser_assignment_expression): Use the location for the LHS as the default location for the expression. gcc/testsuite/ PR preprocessor/53463 * g++.dg/cpp/limits.C: New test. * g++.dg/parse/error19.C: Adjust. * g++.dg/warn/Wconversion-real-integer2.C: Likewise. * g++.dg/warn/pr35635.C: Likewise. * g++.old-deja/g++.pt/assign1.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188203 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud