1. 27 Jan, 2016 1 commit
    • re PR c/68062 (ICE when comparing vectors) · fa74a4bc
      	PR c/68062
      	* c-typeck.c (build_binary_op) [EQ_EXPR, GE_EXPR]: Promote operand
      	to unsigned, if needed.  Add -Wsign-compare warning.
      
      	* typeck.c (cp_build_binary_op): Promote operand to unsigned, if
      	needed.  Add -Wsign-compare warning.
      
      	* c-c++-common/vector-compare-4.c: New test.
      
      From-SVN: r232894
      Marek Polacek committed
  2. 26 Jan, 2016 1 commit
  3. 20 Jan, 2016 2 commits
  4. 14 Jan, 2016 2 commits
  5. 13 Jan, 2016 1 commit
    • Improve warning locations (PR66208) · 3342fd71
      	PR c/66208
      	* c-common.c (check_function_nonnull): Remove unnecessary declaration.
      	Add new arg loc and pass it down as context.
      	(check_nonnull_arg): Don't mark ctx arg as unused. Use it as a pointer
      	to the location to use for the warning.
      	(check_function_arguments): New arg loc.  All callers changed.  Pass
      	it to check_function_nonnull.
      	* c-common.h (check_function_arguments): Adjust declaration.
      
      testsuite/
      	PR c/66208
      	* c-c++-common/pr66208.c: New file.
      
      From-SVN: r232345
      Bernd Schmidt committed
  6. 06 Jan, 2016 2 commits
    • C: fix reported range of invalid unary dereference. · 7443cf13
      gcc/c/ChangeLog:
      	* c-parser.c (c_parser_unary_expression): For dereferences, build
      	a combined location before calling build_indirect_ref, so that
      	error reports cover the full range, manually updating the c_expr
      	src_range.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/bad-dereference.c: New test case.
      
      From-SVN: r232110
      David Malcolm committed
    • re PR sanitizer/69099 (ICE when compiling gcc.dg/atomic/c11-atomic-exec-2.c with… · 6b131d5b
      re PR sanitizer/69099 (ICE when compiling gcc.dg/atomic/c11-atomic-exec-2.c with -fsanitize=float-cast-overflow)
      
      	PR sanitizer/69099
      	* c-convert.c (convert) [INTEGER_TYPE]: Drop ARG.  Don't pass ARG to
      	ubsan_instrument_float_cast.  Fold EXPR.  Use NULL_TREE instead of
      	NULL.
      
      	* convert.c (convert_to_integer_1): Adjust call to
      	ubsan_instrument_float_cast.  Use NULL_TREE instead of NULL.
      	* ubsan.c (ubsan_instrument_float_cast): Drop the ARG parameter.  Use
      	EXPR instead of ARG.
      	* ubsan.h (ubsan_instrument_float_cast): Adjust declaration.
      
      	* gcc.dg/ubsan/float-cast-overflow-atomic.c: New test.
      
      From-SVN: r232099
      Marek Polacek committed
  7. 04 Jan, 2016 2 commits
  8. 23 Dec, 2015 1 commit
  9. 22 Dec, 2015 1 commit
  10. 21 Dec, 2015 1 commit
    • C and C++ FE: fix source ranges for binary ops · 745e411d
      gcc/c-family/ChangeLog:
      	* c-common.c (binary_op_error): Convert first param from
      	location_t to rich_location * and use it when emitting an error.
      	* c-common.h (binary_op_error): Convert first param from
      	location_t to rich_location *.
      
      gcc/c/ChangeLog:
      	* c-typeck.c: Include "gcc-rich-location.h".
      	(build_binary_op): In the two places that call binary_op_error,
      	create a gcc_rich_location and populate it with the location of
      	the binary op and its two operands.
      
      gcc/cp/ChangeLog:
      	* typeck.c (cp_build_binary_op): Update for change in signature
      	of build_binary_op.  Use error_at to replace an implicit use
      	of input_location with param "location" in "invalid operands"
      	error.
      	(cp_build_binary_op): Replace an error with an error_at, using
      	"location", rather than implicitly using input_location.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/diagnostic/bad-binary-ops.C: New test case.
      	* gcc.dg/bad-binary-ops.c: New test case.
      	gcc.dg/plugin/diagnostic_plugin_show_trees.c (get_range_for_expr):
      	Remove material copied from gcc-rich-location.c
      	(gcc_rich_location::add_expr): Likewise.
      
      From-SVN: r231884
      David Malcolm committed
  11. 17 Dec, 2015 1 commit
    • C FE: improvements to ranges of bad return values · 94c40e19
      gcc/c/ChangeLog:
      	* c-parser.c (c_parser_statement_after_labels): When calling
      	c_finish_return, Use the return expression's location if it has
      	one, falling back to the location of the first token within it.
      	* c-typeck.c (c_finish_return): When issuing warnings about
      	the incorrect presence/absence of a return value, issue a note
      	showing the declaration of the function.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/diagnostic-range-bad-return.c: New test case.
      
      From-SVN: r231786
      David Malcolm committed
  12. 16 Dec, 2015 4 commits
    • Better error recovery for merge-conflict markers · de67c4c3
      gcc/c-family/ChangeLog:
      	* c-common.h (conflict_marker_get_final_tok_kind): New prototype.
      	* c-lex.c (conflict_marker_get_final_tok_kind): New function.
      
      gcc/c/ChangeLog:
      	* c-parser.c (struct c_parser): Expand array "tokens_buf" from 2
      	to 4.
      	(c_parser_peek_nth_token): New function.
      	(c_parser_peek_conflict_marker): New function.
      	(c_parser_error): Detect conflict markers and report them as such.
      
      gcc/cp/ChangeLog:
      	* parser.c (cp_lexer_peek_conflict_marker): New function.
      	(cp_parser_error): Detect conflict markers and report them as
      	such.
      
      gcc/testsuite/ChangeLog:
      	* c-c++-common/conflict-markers-1.c: New testcase.
      	* c-c++-common/conflict-markers-2.c: Likewise.
      	* c-c++-common/conflict-markers-3.c: Likewise.
      	* c-c++-common/conflict-markers-4.c: Likewise.
      	* c-c++-common/conflict-markers-5.c: Likewise.
      	* c-c++-common/conflict-markers-6.c: Likewise.
      	* c-c++-common/conflict-markers-7.c: Likewise.
      	* c-c++-common/conflict-markers-8.c: Likewise.
      	* c-c++-common/conflict-markers-9.c: Likewise.
      	* c-c++-common/conflict-markers-10.c: Likewise.
      	* c-c++-common/conflict-markers-11.c: Likewise.
      	* g++.dg/conflict-markers-1.C: Likewise.
      
      From-SVN: r231712
      David Malcolm committed
    • C FE: fix range of primary-expression in c_parser_postfix_expression · a10704e1
      gcc/c/ChangeLog:
      	* c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC
      	to preserve range information for the primary expression
      	in the call to c_parser_postfix_expression_after_primary.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/cast-function-1.c (bar): Update column numbers.
      	* gcc.dg/diagnostic-range-bad-called-object.c: New test case.
      
      From-SVN: r231709
      David Malcolm committed
    • C FE: use correct location range for static assertions · 8062bca6
      gcc/c/ChangeLog:
      	* c-parser.c (c_parser_static_assert_declaration_no_semi): Use the
      	expression location, falling back on the first token location,
      	rather than always using the latter.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/diagnostic-range-static-assert.c: New test case.
      
      From-SVN: r231704
      David Malcolm committed
    • re PR c/64637 (Incorrect location for -Wunused-value warnings in for-loop) · d06f8b75
      	PR c/64637
      	* c-typeck.c (c_process_expr_stmt): Use location of the expression if
      	available.
      
      	* gcc.dg/pr64637.c: New test.
      
      From-SVN: r231700
      Marek Polacek committed
  13. 15 Dec, 2015 1 commit
  14. 09 Dec, 2015 1 commit
  15. 08 Dec, 2015 2 commits
    • C: fix uninitialized ranges for __alignof__ · a1b93f8d
      gcc/c/ChangeLog:
      	* c-parser.c (c_parser_alignof_expression): Capture location of
      	closing parenthesis (if any), or of end of unary expression, and
      	use it to build a src_range for the expression.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/plugin/diagnostic-test-expressions-1.c (test_alignof):
      	New test function.
      
      From-SVN: r231415
      David Malcolm committed
    • PR c/68757: fix uninitialized src_range for various builtins · 46c6e1e2
      gcc/c/ChangeLog:
      	PR c/68757
      	* c-parser.c (c_parser_get_builtin_args): Add
      	"out_close_paren_loc" param, and write back to it.
      	(c_parser_postfix_expression): Capture the closing
      	parenthesis location for RID_CHOOSE_EXPR,
      	RID_BUILTIN_CALL_WITH_STATIC_CHAIN, RID_BUILTIN_COMPLEX,
      	RID_BUILTIN_SHUFFLE and use it to set the source range
      	for such expressions; within RID_BUILTIN_COMPLEX set
      	the underlying location.
      
      gcc/testsuite/ChangeLog:
      	PR c/68757
      	* gcc.dg/plugin/diagnostic-test-expressions-1.c
      	(test_builtin_choose_expr): New test function.
      	(test_builtin_call_with_static_chain): Likewise.
      	(test_builtin_complex): Likewise.
      	(test_builtin_shuffle): Likewise.
      
      From-SVN: r231414
      David Malcolm committed
  16. 07 Dec, 2015 1 commit
  17. 04 Dec, 2015 1 commit
    • c-tree.h (c_build_va_arg): Adjust prototype. · f187980b
      	* c-tree.h (c_build_va_arg): Adjust prototype.
      	* c-parser.c (c_parser_postfix_expression): Adjust call to above.
      	* c-typeck.c (c_build_va_arg): Rename LOC parameter to LOC2, add LOC1
      	parameter, adjust throughout and issue an error if EXPR is a component
      	with reverse storage order.
      
      From-SVN: r231250
      Eric Botcazou committed
  18. 02 Dec, 2015 4 commits
    • Define c_fully_fold separately for C and C++. · 4250754e
      gcc/c-family/
      	* c-common.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
      	(c_fully_fold_internal, decl_constant_value_for_optimization):
      	Move to c/c-fold.c.
      	* c-common.h: Don't declare decl_constant_value_for_optimization.
      gcc/c/
      	* c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
      	(c_fully_fold_internal, decl_constant_value_for_optimization):
      	Move from c-common.c.
      	* c-tree.h: Declare decl_constant_value_for_optimization.
      	* Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
      gcc/cp/
      	* cp-gimplify.c (c_fully_fold): Define.
      
      From-SVN: r231196
      Jason Merrill committed
    • Fix TYPE_MAIN_VARIANT construction for arrays of qualified typedefs (PR c/68162). · e9e32ee6
      PR c/68162 reports a spurious warning about incompatible types
      involving arrays of const double, constructed in one place using a
      typedef for const double and in another place literally using const
      double.
      
      The problem is that the array of the typedef was incorrectly
      constructed without a TYPE_MAIN_VARIANT being an array of unqualified
      elements as it should be (though it seems some more recent change
      resulted in this producing incorrect diagnostics, likely the support
      for C++-style handling of arrays of qualified type).  This patch fixes
      the logic in grokdeclarator to determine first_non_attr_kind, which is
      used to determine whether it is necessary to use the TYPE_MAIN_VARIANT
      of the type in the declaration specifiers.
      
      However, fixing that logic introduces a failure of
      gcc.dg/debug/dwarf2/pr47939-4.c, a test introduced along with
      first_non_attr_kind.  Thus, it is necessary to track the original
      qualified typedef when qualifying an array type, to use it rather than
      a newly-constructed type, to avoid regressing regarding typedef names
      in debug info.  This is done along lines I suggested in
      <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47939#c6>: track the
      original type and the number of levels of array indirection at which
      it appears, and, in possibly affected cases, pass extra arguments to
      c_build_qualified_type (with default arguments to avoid needing to
      pass those extra arguments explicitly everywhere).  Given Richard's
      recent fix to dwarf2out.c, this allows the C bug to be fixed without
      causing debug information regressions.
      
      Bootstrapped with no regressions on x86_64-pc-linux-gnu.
      
      gcc/c:
      	PR c/68162
      	* c-decl.c (grokdeclarator): Set first_non_attr_kind before
      	following link from declarator to next declarator.  Track original
      	qualified type and pass it to c_build_qualified_type.
      	* c-typeck.c (c_build_qualified_type): Add arguments
      	orig_qual_type and orig_qual_indirect.
      
      gcc/c-family:
      	PR c/68162
      	* c-common.h (c_build_qualified_type): Add extra default
      	arguments.
      
      gcc/cp:
      	PR c/68162
      	* tree.c (c_build_qualified_type): Add extra arguments.
      
      gcc/testsuite:
      	PR c/68162
      	* gcc.dg/pr68162-1.c: New test.
      
      From-SVN: r231194
      Joseph Myers committed
    • Some OpenACC host_data cleanup · ff7a55bf
      	gcc/c/
      	* c-parser.c (c_parser_omp_clause_name)
      	(c_parser_oacc_all_clauses): Alphabetical sorting.
      	gcc/cp/
      	* parser.c (cp_parser_omp_clause_name)
      	(cp_parser_oacc_all_clauses): Alphabetical sorting.
      	* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE.
      	gcc/testsuite/
      	* c-c++-common/goacc/host_data-5.c: New file.
      	* c-c++-common/goacc/host_data-6.c: Likewise.
      	* gfortran.dg/goacc/coarray.f95: XFAIL.
      	* gfortran.dg/goacc/coarray_2.f90: Adjust dg-excess-errors
      	directive.
      	* gfortran.dg/goacc/host_data-tree.f95: Remove dg-prune-output
      	directive.
      	libgomp/
      	* testsuite/libgomp.oacc-c-c++-common/host_data-2.c: Restrict to
      	target openacc_nvidia_accel_selected.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-4.c: Likewise.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-5.c: Likewise.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-3.c: Remove file.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-6.c: Remove file.
      
      Co-Authored-By: James Norris <James_Norris@mentor.com>
      Co-Authored-By: Julian Brown <julian@codesourcery.com>
      
      From-SVN: r231184
      Thomas Schwinge committed
    • re PR c/68533 (bogus location for "warning: ‘struct s3’ declared inside… · 657e4e47
      re PR c/68533 (bogus location for "warning: ‘struct s3’ declared inside parameter list will not be visible outside of this definition or declaration")
      
      	PR c/68533
      	* c-decl.c (get_parm_info): Use b->locus instead of input_location
      	for diagnostics.
      
      	* gcc.dg/pr68533.c: New test.
      
      From-SVN: r231147
      Jakub Jelinek committed
  19. 01 Dec, 2015 1 commit
    • OpenACC host_data support. · 37d5ad46
      	gcc/
      	* gimple-pretty-print.c (dump_gimple_omp_target): Add host_data
      	support.
      	* gimple.h (gf_mask): Add GF_OMP_TARGET_KIND_OACC_HOST_DATA.
      	(is_gimple_omp_oacc): Add support for above.
      	* gimplify.c (omp_region_type): Add ORT_ACC_HOST_DATA.
      	(omp_notice_variable): Diagnose undefined implicit uses of
      	use_device variables in offloaded regions.
      	(gimplify_scan_omp_clauses): Add host_data, use_device
      	support. Diagnose undefined mapping of use_device variables in
      	OpenACC clauses.
      	(gimplify_omp_workshare): Add host_data support.
      	(gimplify_expr): Likewise.
      	* omp-builtins.def (BUILT_IN_GOACC_HOST_DATA): New.
      	* omp-low.c (lookup_decl_in_outer_ctx)
      	(maybe_lookup_decl_in_outer_ctx): Add optional argument to skip
      	host_data regions.
      	(scan_sharing_clauses): Support use_device.
      	(check_omp_nesting_restrictions): Support host_data.
      	(expand_omp_target): Support host_data.
      	(lower_omp_target): Skip over outer host_data regions when looking
      	up decls. Support use_device.
      	(make_gimple_omp_edges): Support host_data.
      	* tree-nested.c (convert_nonlocal_omp_clauses): Add use_device
      	clause.
      
      	gcc/c/
      	* c-parser.c (c_parser_omp_clause_name): Add use_device support.
      	(c_parser_oacc_clause_use_device): New function.
      	(c_parser_oacc_all_clauses): Add use_device support.
      	(OACC_HOST_DATA_CLAUSE_MASK): New macro.
      	(c_parser_oacc_host_data): New function.
      	(c_parser_omp_construct): Add host_data support.
      	* c-tree.h (c_finish_oacc_host_data): Add prototype.
      	* c-typeck.c (c_finish_oacc_host_data): New function.
      	(c_finish_omp_clauses): Add use_device support.
      
      	gcc/cp/
      	* cp-tree.h (finish_oacc_host_data): Add prototype.
      	* parser.c (cp_parser_omp_clause_name): Add use_device support.
      	(cp_parser_oacc_all_clauses): Add use_device support.
      	(OACC_HOST_DATA_CLAUSE_MASK): New macro.
      	(cp_parser_oacc_host_data): New function.
      	(cp_parser_omp_construct): Add host_data support.
      	(cp_parser_pragma): Add host_data support.
      	* semantics.c (finish_omp_clauses): Add use_device support.
      	(finish_oacc_host_data): New function.
      
      	gcc/c-family/
      	* c-pragma.c (oacc_pragmas): Add PRAGMA_OACC_HOST_DATA.
      	* c-pragma.h (pragma_kind): Add PRAGMA_OACC_HOST_DATA.
      	(pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_USE_DEVICE.
      
      	libgomp/
      	* oacc-parallel.c (GOACC_host_data): New function.
      	* libgomp.map (GOACC_host_data): Add to GOACC_2.0.1.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-1.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-2.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-3.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-4.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-5.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New test.
      
      
      Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
      Co-Authored-By: James Norris <James_Norris@mentor.com>
      
      From-SVN: r231118
      Julian Brown committed
  20. 29 Nov, 2015 1 commit
  21. 27 Nov, 2015 2 commits
    • Fix memory leak in cilk · b58d3df2
      	PR c++/68312
      	* c-array-notation.c (fix_builtin_array_notation_fn):
      	Use release_vec_vec instead of vec::release.
      	(build_array_notation_expr): Likewise.
      	(fix_conditional_array_notations_1): Likewise.
      	(fix_array_notation_expr): Likewise.
      	(fix_array_notation_call_expr): Likewise.
      	PR c++/68312
      	* cp-array-notation.c (expand_sec_reduce_builtin):
      	Likewise.
      	(create_array_refs): Replace argument with const reference.
      	(expand_an_in_modify_expr): Likewise.
      	(cp_expand_cond_array_notations): Likewise.
      	(expand_unary_array_notation_exprs): Likewise.
      	PR c++/68312
      	* array-notation-common.c (cilkplus_extract_an_triplets):
      	Release vector of vectors.
      	* cilk.c (gimplify_cilk_spawn): Free allocated memory.
      	PR c++/68312
      	* vec.h (release_vec_vec): New function.
      
      From-SVN: r231001
      Martin Liska committed
    • re PR c/63326 (whether a #pragma is a statement depends on the type of pragma) · aec17bfe
      	PR c/63326
      	* c-parser.c (c_parser_compound_statement_nostart): If
      	last_label is true, use pragma_stmt instead of pragma_compound
      	as second c_parser_pragma argument.
      	(c_parser_omp_ordered, c_parser_omp_target_update,
      	c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
      	false as second argument to c_parser_skip_to_pragma_eol after
      	diagnosing standalone directives used in pragma_stmt context.
      
      	* parser.c (cp_parser_statement): Clear in_compound after labels.
      
      	* gcc.dg/gomp/barrier-2.c (f2): Expect another error after label.
      	* c-c++-common/gomp/pr63326.c: New test.
      
      	* testsuite/libgomp.c/cancel-parallel-2.c (foo): Add semicolon
      	in between case label and OpenMP standalone directives.
      	* testsuite/libgomp.c++/cancel-parallel-2.C (foo): Likewise.
      
      From-SVN: r230999
      Jakub Jelinek committed
  22. 24 Nov, 2015 1 commit
  23. 23 Nov, 2015 1 commit
    • Fix PR objc/68438 (uninitialized source ranges) · cbd03aee
      gcc/c/ChangeLog:
      	PR objc/68438
      	* c-parser.c (c_parser_postfix_expression): Set up source ranges
      	for various Objective-C constructs: Class.name syntax,
      	@selector(), @protocol(), @encode(), and [] message syntax.
      
      gcc/testsuite/ChangeLog:
      	PR objc/68438
      	* objc.dg/plugin: New subdirectory.
      	* objc.dg/plugin/diagnostic-test-expressions-1.m: New test file.
      	* objc.dg/plugin/plugin.exp: New file, based on
      	gcc.dg/plugin/plugin.exp.
      
      From-SVN: r230775
      David Malcolm committed
  24. 20 Nov, 2015 2 commits
    • PR 62314: add ability to add fixit-hints to a diagnostic · a87a86e1
      This is the combination of two patches:
        [PATCH 01/02] PR/62314: add ability to add fixit-hints
        [PATCH 02/02] C FE: add fix-it hint for . vs ->
      
      gcc/ChangeLog:
      	PR 62314
      	* diagnostic-show-locus.c (colorizer::set_fixit_hint): New.
      	(class layout): Update comment
      	(layout::print_any_fixits): New method.
      	(layout::move_to_column): New method.
      	(diagnostic_show_locus): Add call to layout.print_any_fixits.
      
      gcc/c/ChangeLog:
      	PR 62314
      	* c-typeck.c (should_suggest_deref_p): New function.
      	(build_component_ref): Special-case POINTER_TYPE when
      	generating a "not a structure of union"  error message, and
      	suggest a "->" rather than a ".", providing a fix-it hint.
      
      gcc/testsuite/ChangeLog:
      	PR 62314
      	* gcc.dg/fixits.c: New file.
      	* gcc.dg/plugin/diagnostic-test-show-locus-ascii-bw.c
      	(test_fixit_insert): New.
      	(test_fixit_remove): New.
      	(test_fixit_replace): New.
      	* gcc.dg/plugin/diagnostic-test-show-locus-ascii-color.c
      	(test_fixit_insert): New.
      	(test_fixit_remove): New.
      	(test_fixit_replace): New.
      	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
      	(test_show_locus): Add tests of rendering fixit hints.
      
      libcpp/ChangeLog:
      	PR 62314
      	* include/line-map.h (source_range::intersects_line_p): New
      	method.
      	(rich_location::~rich_location): New.
      	(rich_location::add_fixit_insert): New method.
      	(rich_location::add_fixit_remove): New method.
      	(rich_location::add_fixit_replace): New method.
      	(rich_location::get_num_fixit_hints): New accessor.
      	(rich_location::get_fixit_hint): New accessor.
      	(rich_location::MAX_FIXIT_HINTS): New constant.
      	(rich_location::m_num_fixit_hints): New field.
      	(rich_location::m_fixit_hints): New field.
      	(class fixit_hint): New class.
      	(class fixit_insert): New class.
      	(class fixit_remove): New class.
      	(class fixit_replace): New class.
      	* line-map.c (source_range::intersects_line_p): New method.
      	(rich_location::rich_location): Add initialization of
      	m_num_fixit_hints to both ctors.
      	(rich_location::~rich_location): New.
      	(rich_location::add_fixit_insert): New method.
      	(rich_location::add_fixit_remove): New method.
      	(rich_location::add_fixit_replace): New method.
      	(fixit_insert::fixit_insert): New.
      	(fixit_insert::~fixit_insert): New.
      	(fixit_insert::affects_line_p): New.
      	(fixit_remove::fixit_remove): New.
      	(fixit_remove::affects_line_p): New.
      	(fixit_replace::fixit_replace): New.
      	(fixit_replace::~fixit_replace): New.
      	(fixit_replace::affects_line_p): New.
      
      From-SVN: r230674
      David Malcolm committed
    • C++ FE: offer suggestions for misspelled field names · 8ece8dfb
      gcc/c/ChangeLog:
      	* c-typeck.c (lookup_field_fuzzy): Move determination of closest
      	candidate into a new function, find_closest_identifier.
      
      gcc/cp/ChangeLog:
      	* cp-tree.h (lookup_member_fuzzy): New decl.
      	* search.c: Include spellcheck.h.
      	(class lookup_field_fuzzy_info): New class.
      	(lookup_field_fuzzy_info::fuzzy_lookup_fnfields): New.
      	(lookup_field_fuzzy_info::fuzzy_lookup_field): New.
      	(lookup_field_fuzzy_r): New.
      	(lookup_member_fuzzy): New.
      	* typeck.c (finish_class_member_access_expr): When issuing
      	a "has no member named" error, call lookup_member_fuzzy, and
      	offer any result as a suggestion.
      
      gcc/ChangeLog:
      	* spellcheck-tree.c (find_closest_identifier): New function, taken
      	from c/c-typeck.c:lookup_field_fuzzy, with NULL corrected to
      	NULL_TREE in two places.
      	* spellcheck.h (find_closest_identifier): New decl.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/spellcheck-fields.C: New file.
      
      From-SVN: r230638
      David Malcolm committed
  25. 19 Nov, 2015 1 commit
  26. 17 Nov, 2015 1 commit
    • Fix uninitialized src_range values for c_expr · bef08b71
      gcc/c/ChangeLog:
      	* c-parser.c (set_c_expr_source_range): Bulletproof both
      	overloaded implementations against NULL expr->value.
      	(c_parser_braced_init): Set src_range for "ret" to a sane pair of
      	values.
      	(c_parser_unary_expression): Likewise when handling addresses of
      	labels.
      	(c_parser_postfix_expression): Likewise for statement expressions,
      	for __FUNCTION__, __PRETTY_FUNCTION_ and __func__ keywords, for
      	__builtin_va_arg, and for __builtin_offset_of.
      	(c_parser_postfix_expression_after_paren_type): Initialize expr's
      	src_range using the range of the braced initializer.
      	(c_parser_transaction_expression): Set src_range for "ret" to a
      	sane pair of values.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/plugin/diagnostic-test-expressions-1.c (vector): New
      	macro.
      	(test_braced_init): New function.
      	(test_statement_expression): New function.
      	(test_address_of_label): New function.
      	(test_transaction_expressions): New function.
      	(test_keywords): New function.
      	(test_builtin_va_arg): New function.
      	(test_builtin_offsetof): New function.
      	* lib/multiline.exp (_build_multiline_regex): Escape braces.
      
      From-SVN: r230497
      David Malcolm committed
  27. 16 Nov, 2015 1 commit
    • Add __attribute__((__simd__)) to GCC. · fff77217
      gcc/
      	* omp-low.c (pass_omp_simd_clone::gate): If target allows - call
      	without additional conditions.
      	* doc/extend.texi (@item simd): New.
      gcc/c-family/
      	* c-common.c (handle_simd_attribute): New.
      	(struct attribute_spec): Add entry for "simd".
      	(handle_simd_attribute): New.
      gcc/c/
      	* c-parser.c (c_finish_omp_declare_simd): Look for
      	"simd" attribute as well. Update error message.
      gcc/cp/
      	* parser.c (cp_parser_late_parsing_cilk_simd_fn_info): Look for
      	"simd" attribute as well. Update error message.
      gcc/testsuite/
      	* c-c++-common/attr-simd.c: New test.
      	* c-c++-common/attr-simd-2.c: New test.
      	* c-c++-common/attr-simd-3.c: New test.
      
      From-SVN: r230422
      Kirill Yukhin committed