aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/assign-warn-2.c
AgeCommit message (Collapse)AuthorFilesLines
2012-04-30Adjust relevant test cases wrt -ftrack-macro-expansion=[0|2]Dodji Seketeli1-1/+1
Even after all the patches I have already submitted, some test cases where errors happens on tokens that are defined in macros see their output change in an incompatible way, when you run them with or without -ftrack-macro-expansion. I think this is expected, because the (spelling) locus inside the definition of the macro pointed to with -ftrack-macro-expansion is different from the locus of the expansion point of the macro pointed to without -ftrack-macro-expansion. In those cases this patch either adjusts the test case and forces it be run either with -ftrack-macro-expansion, or it just forces it to be run without -ftrack-macro-expansion. There are so many libstdc++ tests that were failing because of that benign issue that I preferred to just run them with -ftrack-macro-expansion diabled, after inspecting each of them to be sure there was nothing more serious underneath. Boostrapped on x86_64-unknown-linux-gnu against trunk with and without -ftrack-macro-expansion turned on. gcc/testsuite/ * objc.dg/foreach-7.m: Force the test case to run without -ftrack-macro-expansion. * c-c++-common/tm/attrib-1.c: Likewise. * c-c++-common/warn-ommitted-condop.c: Likewise. * gcc.dg/assign-warn-1.c: Likewise. * gcc.dg/assign-warn-2.c: Likewise. * gcc.dg/attr-alloc_size.c: Likewise. * gcc.dg/builtin-stringop-chk-1.c: Likewise. * gcc.dg/builtin-stringop-chk-2.c: Likewise. * gcc.dg/builtin-strncat-chk-1.c: Likewise. * gcc.dg/c90-const-expr-9.c: Likewise. * gcc.dg/c99-const-expr-9.c: Likewise. * gcc.dg/cpp/direct2.c: Likewise. Adjust. * gcc.dg/cpp/direct2s.c: Likewise. * gcc/testsuite/gcc.dg/cpp/pr28709.c: Likewise. * gcc.dg/cpp/pragma-diagnostic-1.c: Likewise. * gcc.dg/dfp/composite-type.c: Likewise. * gcc.dg/uninit-6-O0.c: Adjust the test case and force it to run with -ftrack-macro-expansion * g++.dg/cpp0x/constexpr-ex3.C: Likewise. * g++.dg/cpp0x/constexpr-overflow.C: Likewise. * g++.dg/ext/cleanup-1.C: Likewise. * g++.dg/ext/gnu-inline-global-reject.C: Likewise. * g++.dg/template/sfinae10.C: Likewise. * g++.dg/tm/wrap-2.C: Likewise. * g++.dg/warn/Wconversion-real-integer.C: Likewise. * g++.dg/warn/Wsign-conversion.C: Likewise. * g++.dg/warn/multiple-overflow-warn-1.C: Likewise. * g++.old-deja/g++.mike/p10769b.C: Likewise. * g++.dg/warn/Wdouble-promotion.C: Adjust the test case and force it to run with -ftrack-macro-expansion. * libstdc++-v3/scripts/testsuite_flags.in: By default, run the test cases without -ftrack-macro-expansion. From-SVN: r186976
2010-06-04re PR c/25880 (improve message of warning for discarding qualifiers)Manuel López-Ibáñez1-10/+10
2010-06-04 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/25880 * c-objc-common.c (c_tree_printer): Handle %V, %v and %#v. * c-format.c (gcc_diag_flag_specs): Add hash. (gcc_cxxdiag_flag_specs): Use gcc_diag_flag_specs directly. (gcc_tdiag_char_table,gcc_cdiag_char_table): Handle %V and %v. * c-pretty-print.c (pp_c_cv_qualifier): Rename as pp_c_cv_qualifiers. Handle qualifiers spelling here. (pp_c_type_qualifier_list): Call the function above. * c-pretty-print.h (pp_c_cv_qualifiers): Declare. * c-typeck.c (handle_warn_cast_qual): Print qualifiers. (WARN_FOR_QUALIFIERS): New macro. (convert_for_assignment): Use it. testsuite/ * gcc.dg/assign-warn-2.c: Update. * gcc.dg/cpp/line3.c: Update. * gcc.dg/c99-array-lval-8.c: Update. * gcc.dg/cast-qual-2.c: Update. * gcc.dg/c99-arraydecl-3.c: Update. * gcc.dg/assign-warn-1.c: Update. * gcc.dg/format/gcc_diag-1.c: Update. From-SVN: r160274
2008-10-22re PR c/30949 ("incompatible pointer type" warning does not point to ↵Manuel López-Ibáñez1-5/+5
declaration) 2008-10-22 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/30949 * c-typeck.c (convert_for_assignment): Do not give declaration's location for builtins. Spell out which type was expected and which was given. testsuite/ * gcc.target/i386/sse-vect-types.c: Update. * gcc.dg/simd-5.c: Update. * gcc.dg/assign-warn-2.c: Update. * gcc.dg/simd-2.c: Update. * gcc.dg/simd-6.c: Update. * gcc.dg/assign-warn-1.c: Update. * gcc.dg/dfp/composite-type.c: Update. * gcc.dg/simd-1.c: Update. * gcc.dg/pr36997.c: Update. From-SVN: r141298
2008-08-28re PR c/30949 ("incompatible pointer type" warning does not point to ↵Manuel López-Ibáñez1-0/+1
declaration) 2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c/30949 * c-typeck.c (convert_for_assignment): Give a note describing what was passed and what was expected. testsuite/ * gcc.dg/pr30949.c: New. * gcc.dg/transparent-union-1.c: Update. * gcc.dg/cleanup-1.c: Update. * gcc.dg/assign-warn-2.c: Update. * gcc.dg/conv-2.c: Update. * gcc.dg/Wpointer-sign-pedantic.c: Update. * gcc.dg/Wpointer-sign-Wall.c: Update. * gcc.dg/assign-warn-1.c: Update. * gcc.dg/dfp/composite-type.c: Update. * gcc.dg/noncompile/20020213-1.c: Update. From-SVN: r139729
2007-07-12re PR testsuite/25241 ([C++] DejaGNU does not distinguish between errors and ↵Manuel López-Ibáñez1-92/+92
warnings) 2007-07-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org> Janis Johnson <janis187@us.ibm.com> PR testsuite/25241 gcc/testsuite/ * gcc.test-framework/dg-error-exp-F.c: New test. * gcc.test-framework/dg-warning-exp-F.c: New test. * lib/gcc.exp: Enable warning and error prefixes. * lib/gcc-dg.exp (dg-warning): Wrap original dg-warning. (dg-error): Wrap original dg-error. * gcc.target/powerpc/altivec-types-1.c: Remove explicit error/warning markers from dg-error/dg-warning directives. * gcc.dg/20040322-1.c: Likewise. * gcc.dg/Wchar-subscripts-1.c: Likewise. * gcc.dg/Wdeclaration-after-statement-1.c: Likewise. * gcc.dg/Wdeclaration-after-statement-2.c: Likewise. * gcc.dg/Werror-1.c: Likewise. * gcc.dg/Werror-10.c: Likewise. * gcc.dg/Werror-11.c: Likewise. * gcc.dg/Werror-2.c: Likewise. * gcc.dg/Werror-3.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Werror-5.c: Likewise. * gcc.dg/Werror-6.c: Likewise. * gcc.dg/Werror-7.c: Likewise. * gcc.dg/Werror-8.c: Likewise. * gcc.dg/Werror-9.c: Likewise. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Wimplicit-function-declaration-c89-pedantic.c: Likewise. * gcc.dg/Wimplicit-function-declaration-c89.c: Likewise. * gcc.dg/Wimplicit-function-declaration-c99-pedantic.c: Likewise. * gcc.dg/Wimplicit-function-declaration-c99.c: Likewise. * gcc.dg/Wint-to-pointer-cast-1.c: Likewise. * gcc.dg/Wint-to-pointer-cast-2.c: Likewise. * gcc.dg/Wint-to-pointer-cast-3.c: Likewise. * gcc.dg/Wnested-externs-1.c: Likewise. * gcc.dg/Wpointer-to-int-cast-1.c: Likewise. * gcc.dg/Wpointer-to-int-cast-2.c: Likewise. * gcc.dg/Wpointer-to-int-cast-3.c: Likewise. * gcc.dg/Wshadow-3.c: Likewise. * gcc.dg/Wtraditional-conversion-2.c: Likewise. * gcc.dg/Wwrite-strings-1.c: Likewise. * gcc.dg/anon-struct-5.c: Likewise. * gcc.dg/anon-struct-6.c: Likewise. * gcc.dg/anon-struct-7.c: Likewise. * gcc.dg/anon-struct-8.c: Likewise. * gcc.dg/array-8.c: Likewise. * gcc.dg/array-quals-2.c: Likewise. * gcc.dg/asm-qual-1.c: Likewise. * gcc.dg/asm-wide-1.c: Likewise. * gcc.dg/assign-warn-1.c: Likewise. * gcc.dg/assign-warn-2.c: Likewise. * gcc.dg/bitfld-10.c: Likewise. * gcc.dg/bitfld-11.c: Likewise. * gcc.dg/bitfld-12.c: Likewise. * gcc.dg/bitfld-13.c: Likewise. * gcc.dg/bitfld-14.c: Likewise. * gcc.dg/builtin-choose-expr-2.c: Likewise. * gcc.dg/builtins-30.c: Likewise. * gcc.dg/c90-const-expr-5.c: Likewise. * gcc.dg/c90-typespec-1.c: Likewise. * gcc.dg/c99-const-expr-5.c: Likewise. * gcc.dg/c99-flex-array-5.c: Likewise. * gcc.dg/c99-fordecl-3.c: Likewise. * gcc.dg/c99-tag-3.c: Likewise. * gcc.dg/c99-typespec-1.c: Likewise. * gcc.dg/c99-vla-jump-1.c: Likewise. * gcc.dg/c99-vla-jump-2.c: Likewise. * gcc.dg/c99-vla-jump-3.c: Likewise. * gcc.dg/c99-vla-jump-4.c: Likewise. * gcc.dg/c99-vla-jump-5.c: Likewise. * gcc.dg/cast-1.c: Likewise. * gcc.dg/cast-2.c: Likewise. * gcc.dg/cast-3.c: Likewise. * gcc.dg/cast-4.c: Likewise. * gcc.dg/cast-pretty-print-1.c: Likewise. * gcc.dg/comp-goto-2.c: Likewise. * gcc.dg/comp-goto-3.c: Likewise. * gcc.dg/cpp/error-1.c: Likewise. * gcc.dg/cpp/if-paren.c: Likewise. * gcc.dg/decl-7.c: Likewise. * gcc.dg/decl-8.c: Likewise. * gcc.dg/decl-nospec-1.c: Likewise. * gcc.dg/decl-nospec-2.c: Likewise. * gcc.dg/decl-nospec-3.c: Likewise. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/declspec-12.c: Likewise. * gcc.dg/declspec-13.c: Likewise. * gcc.dg/declspec-14.c: Likewise. * gcc.dg/declspec-15.c: Likewise. * gcc.dg/declspec-16.c: Likewise. * gcc.dg/declspec-17.c: Likewise. * gcc.dg/declspec-4.c: Likewise. * gcc.dg/declspec-5.c: Likewise. * gcc.dg/declspec-6.c: Likewise. * gcc.dg/declspec-7.c: Likewise. * gcc.dg/declspec-8.c: Likewise. * gcc.dg/declspec-9.c: Likewise. * gcc.dg/dfp/Wtraditional-conversion-2.c: Likewise. * gcc.dg/dfp/constants-c99.c: Likewise. * gcc.dg/dfp/keywords-c89.c: Likewise. * gcc.dg/dfp/keywords-c99.c: Likewise. * gcc.dg/dfp/keywords-reserved.c: Likewise. * gcc.dg/dfp/typespec.c: Likewise. * gcc.dg/dremf-type-compat-2.c: Likewise. * gcc.dg/dremf-type-compat-3.c: Likewise. * gcc.dg/dremf-type-compat-4.c: Likewise. * gcc.dg/empty-source-2.c: Likewise. * gcc.dg/empty-source-3.c: Likewise. * gcc.dg/enum3.c: Likewise. * gcc.dg/extra-semi-2.c: Likewise. * gcc.dg/extra-semi-3.c: Likewise. * gcc.dg/float-range-1.c: Likewise. * gcc.dg/float-range-2.c: Likewise. * gcc.dg/float-range-3.c: Likewise. * gcc.dg/float-range-5.c: Likewise. * gcc.dg/format/asm_fprintf-2.c: Likewise. * gcc.dg/format/asm_fprintf-3.c: Likewise. * gcc.dg/format/asm_fprintf-4.c: Likewise. * gcc.dg/format/asm_fprintf-5.c: Likewise. * gcc.dg/format/cast-1.c: Likewise. * gcc.dg/format/gcc_diag-3.c: Likewise. * gcc.dg/format/gcc_diag-4.c: Likewise. * gcc.dg/format/gcc_diag-6.c: Likewise. * gcc.dg/format/gcc_diag-8.c: Likewise. * gcc.dg/format/gcc_diag-9.c: Likewise. * gcc.dg/format/nul-2.c: Likewise. * gcc.dg/format/opt-1.c: Likewise. * gcc.dg/format/opt-2.c: Likewise. * gcc.dg/format/opt-3.c: Likewise. * gcc.dg/format/opt-4.c: Likewise. * gcc.dg/format/opt-5.c: Likewise. * gcc.dg/format/opt-6.c: Likewise. * gcc.dg/framework-2.c: Likewise. * gcc.dg/func-args-1.c: Likewise. * gcc.dg/func-outside-1.c: Likewise. * gcc.dg/func-outside-2.c: Likewise. * gcc.dg/gnu-cond-expr-2.c: Likewise. * gcc.dg/gnu-cond-expr-3.c: Likewise. * gcc.dg/if-empty-1.c: Likewise. * gcc.dg/init-bad-1.c: Likewise. * gcc.dg/init-bad-2.c: Likewise. * gcc.dg/init-bad-3.c: Likewise. * gcc.dg/init-desig-obs-2.c: Likewise. * gcc.dg/init-desig-obs-3.c: Likewise. * gcc.dg/init-empty-2.c: Likewise. * gcc.dg/init-empty-3.c: Likewise. * gcc.dg/inline-11.c: Likewise. * gcc.dg/inline-12.c: Likewise. * gcc.dg/inline-8.c: Likewise. * gcc.dg/inline-9.c: Likewise. * gcc.dg/inline3.c: Likewise. * gcc.dg/label-decl-1.c: Likewise. * gcc.dg/label-decl-2.c: Likewise. * gcc.dg/label-decl-3.c: Likewise. * gcc.dg/label-decl-4.c: Likewise. * gcc.dg/long-long-typespec-1.c: Likewise. * gcc.dg/lvalue-2.c: Likewise. * gcc.dg/lvalue-3.c: Likewise. * gcc.dg/nested-func-3.c: Likewise. * gcc.dg/nested-redef-1.c: Likewise. * gcc.dg/noreturn-4.c: Likewise. * gcc.dg/old-style-prom-2.c: Likewise. * gcc.dg/old-style-prom-3.c: Likewise. * gcc.dg/old-style-then-proto-1.c: Likewise. * gcc.dg/overflow-warn-1.c: Likewise. * gcc.dg/overflow-warn-2.c: Likewise. * gcc.dg/overflow-warn-3.c: Likewise. * gcc.dg/overflow-warn-4.c: Likewise. * gcc.dg/overflow-warn-6.c: Likewise. * gcc.dg/parm-forwdecl-2.c: Likewise. * gcc.dg/parm-forwdecl-3.c: Likewise. * gcc.dg/parm-impl-decl-1.c: Likewise. * gcc.dg/parm-impl-decl-2.c: Likewise. * gcc.dg/parm-incomplete-1.c: Likewise. * gcc.dg/parm-mismatch-1.c: Likewise. * gcc.dg/pointer-arith-1.c: Likewise. * gcc.dg/pointer-arith-2.c: Likewise. * gcc.dg/pointer-arith-3.c: Likewise. * gcc.dg/pointer-arith-4.c: Likewise. * gcc.dg/pointer-arith-6.c: Likewise. * gcc.dg/pointer-arith-7.c: Likewise. * gcc.dg/pointer-arith-8.c: Likewise. * gcc.dg/pr13804-1.c: Likewise. * gcc.dg/pr15698-1.c: Likewise. * gcc.dg/pr15698-2.c: Likewise. * gcc.dg/pr15698-3.c: Likewise. * gcc.dg/pr15698-4.c: Likewise. * gcc.dg/pr15698-5.c: Likewise. * gcc.dg/pr15698-6.c: Likewise. * gcc.dg/pr15698-7.c: Likewise. * gcc.dg/pr15698-8.c: Likewise. * gcc.dg/pr17188-1.c: Likewise. * gcc.dg/pr17301-1.c: Likewise. * gcc.dg/pr17301-2.c: Likewise. * gcc.dg/pr17730-1.c: Likewise. * gcc.dg/pr20368-1.c: Likewise. * gcc.dg/pr20368-2.c: Likewise. * gcc.dg/pr20368-3.c: Likewise. * gcc.dg/pr22308-1.c: Likewise. * gcc.dg/qual-component-1.c: Likewise. * gcc.dg/redecl-1.c: Likewise. * gcc.dg/redecl-11.c: Likewise. * gcc.dg/redecl-12.c: Likewise. * gcc.dg/redecl-13.c: Likewise. * gcc.dg/redecl-14.c: Likewise. * gcc.dg/redecl-15.c: Likewise. * gcc.dg/register-var-1.c: Likewise. * gcc.dg/register-var-2.c: Likewise. * gcc.dg/stmt-expr-2.c: Likewise. * gcc.dg/stmt-expr-3.c: Likewise. * gcc.dg/stmt-expr-label-1.c: Likewise. * gcc.dg/stmt-expr-label-2.c: Likewise. * gcc.dg/stmt-expr-label-3.c: Likewise. * gcc.dg/struct-empty-2.c: Likewise. * gcc.dg/struct-empty-3.c: Likewise. * gcc.dg/struct-parse-1.c: Likewise. * gcc.dg/struct-semi-1.c: Likewise. * gcc.dg/struct-semi-2.c: Likewise. * gcc.dg/struct-semi-3.c: Likewise. * gcc.dg/switch-5.c: Likewise. * gcc.dg/switch-6.c: Likewise. * gcc.dg/switch-7.c: Likewise. * gcc.dg/tls/diag-5.c: Likewise. * gcc.dg/transparent-union-1.c: Likewise. * gcc.dg/transparent-union-3.c: Likewise. * gcc.dg/typespec-1.c: Likewise. * gcc.dg/vla-init-2.c: Likewise. * gcc.dg/vla-init-3.c: Likewise. * gcc.dg/vla-init-4.c: Likewise. * gcc.dg/vla-init-5.c: Likewise. * gcc.dg/void-cast-2.c: Likewise. * gcc.dg/wvla-3.c: Likewise. * gcc.dg/wvla-7.c: Likewise. * gcc.target/i386/991209-1.c: Likewise. * gcc.target/ia64/fpreg-1.c: Likewise. * gcc.target/m68k/interrupt_thread-2.c: Likewise. * gcc.target/m68k/interrupt_thread-3.c: Likewise. From-SVN: r126606
2004-10-08c-typeck.c (enum impl_conv): New.Joseph Myers1-0/+124
* c-typeck.c (enum impl_conv): New. (convert_for_assignment): Use it. Take tree for function called instead of its name. Handle ObjC selectors for diagnostics at start of function. Select diagnostic text within the function using full sentences for diagnsotics. Use %qE to name functions in diagnostics. (convert_arguments, build_modify_expr, c_convert_parm_for_inlining, digest_init, c_finish_return): Update callers to convert_for_assignment. (warn_for_assignment): Remove. testsuite: * gcc.dg/assign-warn-1.c, gcc.dg/assign-warn-2.c: New tests. * gcc.dg/warn-1.c, gcc.dg/noncompile/20020213-1.c, objc.dg/method-9.m: Update expected diagnostics. From-SVN: r88741