gcc/ChangeLog: * convert.c (convert_to_real_1): When converting from a REAL_TYPE, preserve the location of EXPR in the result. * tree.c (get_pure_location): Make non-static. (set_source_range): Return the resulting location_t. (make_location): New function. * tree.h (get_pure_location): New decl. (get_finish): New inline function. (set_source_range): Convert return type from void to location_t. (make_location): New decl. gcc/cp/ChangeLog: * cp-tree.h (class cp_expr): New class. (finish_parenthesized_expr): Convert return type and param to cp_expr. (perform_koenig_lookup): Convert return type and param from tree to cp_expr. (finish_increment_expr): Likewise. (finish_unary_op_expr): Likewise. (finish_id_expression): Likewise for return type. (build_class_member_access_expr): Likewise for param. (finish_class_member_access_expr): Likewise. (build_x_unary_op): Likewise. (build_c_cast): New decl. (build_x_modify_expr): Convert return type from tree to cp_expr. * cvt.c (cp_convert_and_check): When warning about conversions, attempt to use the location of "expr" if available, otherwise falling back to the old behavior of using input_location. * name-lookup.c (lookup_arg_dependent_1): Convert return type from tree to cp_expr. (lookup_arg_dependent): Likewise; also for local "ret". * name-lookup.h (lookup_arg_dependent): Likewise for return type. * parser.c (cp_lexer_previous_token): Skip past purged tokens. (struct cp_parser_expression_stack_entry): Convert field "lhs" to cp_expr. (cp_parser_identifier): Likewise for return type. Use cp_expr ctor to preserve the token's location. (cp_parser_string_literal): Likewise, building up a meaningful location for the case where a compound string literal is built by concatentation. (cp_parser_userdef_char_literal): Likewise for return type. (cp_parser_userdef_numeric_literal): Likewise. (cp_parser_statement_expr): Convert return type to cp_expr. Generate a suitable location for the expr and return it via the cp_expr ctor. (cp_parser_fold_expression): Convert return type to cp_expr. (cp_parser_primary_expression): Likewise, and for locals "expr", "lam", "id_expression", "decl". Use cp_expr ctor when parsing literals, to preserve the spelling location of the token. Preserve the locations of parentheses. Preserve location when calling objc_lookup_ivar. Preserve the location for "this" tokens. Generate suitable locations for "__builtin_va_arg" constructs and for Objective C 2.0 dot-syntax. Set the location for the result of finish_id_expression. (cp_parser_primary_expression): Convert return type from tree to cp_expr. (cp_parser_id_expression): Likewise. (cp_parser_unqualified_id): Likewise. Also for local "id". (cp_parser_postfix_expression): Likewise, also for local "postfix_expression". Generate suitable locations for C++-style casts, "_Cilk_spawn" constructs. Convert local "initializer" to cp_expr and use it to preserve the location of compound literals. Capture the location of the closing parenthesis of a call site via cp_parser_parenthesized_expression_list, and use it to build a source range for a call. Use cp_expr in ternary expression. (cp_parser_postfix_dot_deref_expression): Convert param from tree to cp_expr. Generate and set a location. (cp_parser_parenthesized_expression_list): Add "close_paren_loc" out-param, and write back to it. (cp_parser_unary_expression): Convert return type from tree to cp_expr. Also for locals "cast_expression" and "expression". Generate and use suitable locations for addresses of labels and for cast expressions. Call cp_expr::set_location where necessary. Preserve the locations of negated numeric literals. (cp_parser_new_expression): Generate meaningful locations/ranges. (cp_parser_cast_expression): Convert return type from tree to cp_expr; also for local "expr". Use the paren location to generate a meaningful range for the expression. (cp_parser_binary_expression): Convert return type from tree to cp_expr; also for local "rhs". Generate a meaningful location for the expression, and use it. Replace call to protected_set_expr_location by converting a build2 to a build2_loc and using the location in the call to build_x_binary_op, adding a cp_expr::set_location to the latter case. (cp_parser_question_colon_clause): Convert param from tree to cp_expr; also for local "assignment_expr". Set the spelling range of the expression. (cp_parser_assignment_expression): Likewise for return type and locals "expr" and "rhs". Build a meaningful spelling range for the expression. Remove saving of input_location in favor of a call to cp_expr::set_location. (cp_parser_expression): Convert return type and locals "expression" and "assignment_expression" to cp_expr. Build a meaningful spelling range for assignment expressions. (cp_parser_constant_expression): Likewise for return type and local "expression". (cp_parser_builtin_offsetof): Convert return type and local "expr" to cp_expr. Generate suitable locations. (cp_parser_lambda_expression): Convert return return type to cp_expr. (cp_parser_operator_function_id): Likewise. (cp_parser_operator): Likewise. Generate a meaningful range, using cp_expr's ctor to return it. (cp_parser_template_id): When converting a token to CPP_TEMPLATE_ID, update the location. (cp_parser_initializer_clause): Convert return type and local "initializer" to cp_expr. (cp_parser_braced_list): Likewise for return type. Generate suitable locations. (cp_parser_lookup_name): Likewise for return type. Use cp_expr's ctor to preserve the location_t of the name. (cp_parser_simple_cast_expression): Likewise for return type. (cp_parser_functional_cast): Convert return type and local "cast" to cp_expr. Generate suitable locations. (cp_parser_objc_expression): Convert return type to cp_expr.k Generate (cp_parser_objc_message_expression): Generate suitable locations. (cp_parser_objc_encode_expression): Convert return type to cp_expr. Generate suitable locations. (cp_parser_objc_protocol_expression): Generate suitable locations. (cp_parser_objc_selector_expression): Generate suitable locations. (cp_parser_omp_for_cond): Attempt to use the location of "cond" for the binary op. (cp_parser_transaction_expression): Issue the tm-not-enabled error at the location of the __transaction_foo token, rather than at input_location. * semantics.c (finish_parenthesized_expr): Convert return type and param to cp_expr. Preserve location. (perform_koenig_lookup): Likewise for return type and param. (finish_increment_expr): Likewise. Generate suitable locations. (finish_unary_op_expr): Likewise for return type and local "result". Generate suitable locations. (finish_id_expression): Convert return type to cp_expr and use cp_expr ctor to preserve location information. * typeck.c (build_class_member_access_expr): Convert param to cp_expr. (finish_class_member_access_expr): Likewise. (cp_build_binary_op): Convert a build2 to a build2_loc. (build_x_unary_op): Convert param from tree to cp_expr. (build_nop): Preserve the location of EXPR. (build_c_cast): Provide an overloaded variant that takes a cp_expr and returns a cp_expr. (build_x_modify_expr): Convert return type from tree to cp_expr. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-template14.C: Move dg-error directive. * g++.dg/gomp/loop-1.C: Update dg-error locations. * g++.dg/plugin/diagnostic-test-expressions-1.C: New file, adapted from gcc.dg/plugin/diagnostic-test-expressions-1.c. * g++.dg/plugin/plugin.exp (plugin_test_list): Add the above. * g++.dg/template/crash55.C: Update dg-error directives. * g++.dg/template/pseudodtor3.C: Update column numbers in dg-error directives. * g++.dg/template/pr64100.C: Update location of dg-error directive. * g++.dg/template/ref3.C: Add XFAIL (PR c++/68699). * g++.dg/ubsan/pr63956.C: Update dg directives to reflect improved location information. * g++.dg/warn/pr35635.C (func3): Update location of a dg-warning. * g++.dg/warn/Wconversion-real-integer2.C: Update location of dg-warning; add a dg-message. * obj-c++.dg/plugin/diagnostic-test-expressions-1.mm: New file, based on objc.dg/plugin/diagnostic-test-expressions-1.m. * obj-c++.dg/plugin/plugin.exp: New file, based on objc.dg/plugin/plugin.exp. From-SVN: r231293
| Name | 
 Last commit 
 | 
Last update | 
|---|---|---|
| .. | ||
| atomic-14.C | Loading commit data... | |
| atomic-17.C | Loading commit data... | |
| atomic-5.C | Loading commit data... | |
| atomic-6.C | Loading commit data... | |
| barrier-1.C | Loading commit data... | |
| barrier-2.C | Loading commit data... | |
| block-0.C | Loading commit data... | |
| block-1.C | Loading commit data... | |
| block-10.C | Loading commit data... | |
| block-11.C | Loading commit data... | |
| block-2.C | Loading commit data... | |
| block-3.C | Loading commit data... | |
| block-4.C | Loading commit data... | |
| block-5.C | Loading commit data... | |
| block-6.C | Loading commit data... | |
| block-7.C | Loading commit data... | |
| block-8.C | Loading commit data... | |
| block-9.C | Loading commit data... | |
| clause-1.C | Loading commit data... | |
| clause-2.C | Loading commit data... | |
| clause-3.C | Loading commit data... | |
| clause-4.C | Loading commit data... | |
| copyin-1.C | Loading commit data... | |
| critical-1.C | Loading commit data... | |
| critical-2.C | Loading commit data... | |
| declare-simd-1.C | Loading commit data... | |
| declare-simd-2.C | Loading commit data... | |
| declare-simd-3.C | Loading commit data... | |
| declare-simd-4.C | Loading commit data... | |
| declare-simd-5.C | Loading commit data... | |
| declare-target-1.C | Loading commit data... | |
| depend-1.C | Loading commit data... | |
| depend-2.C | Loading commit data... | |
| flush-1.C | Loading commit data... | |
| flush-2.C | Loading commit data... | |
| for-1.C | Loading commit data... | |
| for-10.C | Loading commit data... | |
| for-11.C | Loading commit data... | |
| for-12.C | Loading commit data... | |
| for-13.C | Loading commit data... | |
| for-14.C | Loading commit data... | |
| for-15.C | Loading commit data... | |
| for-16.C | Loading commit data... | |
| for-17.C | Loading commit data... | |
| for-18.C | Loading commit data... | |
| for-19.C | Loading commit data... | |
| for-2.C | Loading commit data... | |
| for-20.C | Loading commit data... | |
| for-3.C | Loading commit data... | |
| for-4.C | Loading commit data... | |
| for-5.C | Loading commit data... | |
| for-6.C | Loading commit data... | |
| for-7.C | Loading commit data... | |
| for-8.C | Loading commit data... | |
| for-9.C | Loading commit data... | |
| gomp.exp | Loading commit data... | |
| linear-1.C | Loading commit data... | |
| linear-2.C | Loading commit data... | |
| loop-1.C | Loading commit data... | |
| loop-2.C | Loading commit data... | |
| loop-3.C | Loading commit data... | |
| macro-1.C | Loading commit data... | |
| macro-2.C | Loading commit data... | |
| macro-3.C | Loading commit data... | |
| macro-4.C | Loading commit data... | |
| master-1.C | Loading commit data... | |
| master-2.C | Loading commit data... | |
| master-3.C | Loading commit data... | |
| member-1.C | Loading commit data... | |
| member-2.C | Loading commit data... | |
| member-3.C | Loading commit data... | |
| member-4.C | Loading commit data... | |
| method-1.C | Loading commit data... | |
| openmp-simd-1.C | Loading commit data... | |
| openmp-simd-2.C | Loading commit data... | |
| openmp-simd-3.C | Loading commit data... | |
| ordered-1.C | Loading commit data... | |
| ordered-2.C | Loading commit data... | |
| parallel-1.C | Loading commit data... | |
| parallel-2.C | Loading commit data... | |
| parallel-3.C | Loading commit data... | |
| parallel-4.C | Loading commit data... | |
| parallel-5.C | Loading commit data... | |
| pr24849.C | Loading commit data... | |
| pr25874.C | Loading commit data... | |
| pr25996.C | Loading commit data... | |
| pr26611-1.C | Loading commit data... | |
| pr26611-2.C | Loading commit data... | |
| pr26690-1.C | Loading commit data... | |
| pr26690-2.C | Loading commit data... | |
| pr26823-1.C | Loading commit data... | |
| pr26823-2.C | Loading commit data... | |
| pr26913.C | Loading commit data... | |
| pr27310.C | Loading commit data... | |
| pr27325.C | Loading commit data... | |
| pr27337-1.C | Loading commit data... | |
| pr27337-2.C | Loading commit data... | |
| pr27359.C | Loading commit data... | |
| pr27415.C | Loading commit data... | |
| pr27499.C | Loading commit data... | |
| pr29965-1.C | Loading commit data... | |
| pr29965-10.C | Loading commit data... | |
| pr29965-2.C | Loading commit data... | |
| pr29965-3.C | Loading commit data... | |
| pr29965-4.C | Loading commit data... | |
| pr29965-5.C | Loading commit data... | |
| pr29965-6.C | Loading commit data... | |
| pr29965-7.C | Loading commit data... | |
| pr29965-8.C | Loading commit data... | |
| pr29965-9.C | Loading commit data... | |
| pr30494.C | Loading commit data... | |
| pr30558.C | Loading commit data... | |
| pr30696.C | Loading commit data... | |
| pr31598.C | Loading commit data... | |
| pr31748.C | Loading commit data... | |
| pr31769.C | Loading commit data... | |
| pr32177.C | Loading commit data... | |
| pr33333.C | Loading commit data... | |
| pr33372-1.C | Loading commit data... | |
| pr33372-2.C | Loading commit data... | |
| pr33372-3.C | Loading commit data... | |
| pr33890.C | Loading commit data... | |
| pr34607.C | Loading commit data... | |
| pr34608.C | Loading commit data... | |
| pr34694.C | Loading commit data... | |
| pr34964.C | Loading commit data... | |
| pr35028.C | Loading commit data... | |
| pr35078.C | Loading commit data... | |
| pr35099.C | Loading commit data... | |
| pr35158.C | Loading commit data... | |
| pr35244.C | Loading commit data... | |
| pr35328.C | Loading commit data... | |
| pr35337.C | Loading commit data... | |
| pr35364.C | Loading commit data... | |
| pr35751.C | Loading commit data... | |
| pr36237.C | Loading commit data... | |
| pr36790.C | Loading commit data... | |
| pr37189.C | Loading commit data... | |
| pr37346.C | Loading commit data... | |
| pr37533.C | Loading commit data... | |
| pr38633.C | Loading commit data... | |
| pr38639.C | Loading commit data... | |
| pr39495-1.C | Loading commit data... | |
| pr39495-2.C | Loading commit data... | |
| pr41429.C | Loading commit data... | |
| pr41967.C | Loading commit data... | |
| pr42234.C | Loading commit data... | |
| pr47963.C | Loading commit data... | |
| pr48632.C | Loading commit data... | |
| pr48716.C | Loading commit data... | |
| pr49223-1.C | Loading commit data... | |
| pr49223-2.C | Loading commit data... | |
| pr51360.C | Loading commit data... | |
| pr51669.C | Loading commit data... | |
| pr56217.C | Loading commit data... | |
| pr58567.C | Loading commit data... | |
| pr58702.C | Loading commit data... | |
| pr58874.C | Loading commit data... | |
| pr59150.C | Loading commit data... | |
| pr59297.C | Loading commit data... | |
| pr59628.C | Loading commit data... | |
| pr60682.C | Loading commit data... | |
| pr63249.C | Loading commit data... | |
| pr66571-1.C | Loading commit data... | |
| pr66571-2.C | Loading commit data... | |
| pr67504.C | Loading commit data... | |
| pr67511.C | Loading commit data... | |
| pr67514.C | Loading commit data... | |
| pr67522.C | Loading commit data... | |
| pr67523.C | Loading commit data... | |
| predetermined-1.C | Loading commit data... | |
| private-1.C | Loading commit data... | |
| reference-1.C | Loading commit data... | |
| sections-1.C | Loading commit data... | |
| sections-2.C | Loading commit data... | |
| sections-3.C | Loading commit data... | |
| sections-4.C | Loading commit data... | |
| sharing-1.C | Loading commit data... | |
| sharing-2.C | Loading commit data... | |
| simd-1.C | Loading commit data... | |
| sink-1.C | Loading commit data... | |
| sink-2.C | Loading commit data... | |
| sink-3.C | Loading commit data... | |
| target-1.C | Loading commit data... | |
| target-2.C | Loading commit data... | |
| target-teams-1.C | Loading commit data... | |
| task-1.C | Loading commit data... | |
| taskgroup-1.C | Loading commit data... | |
| teams-1.C | Loading commit data... | |
| this-1.C | Loading commit data... | |
| this-2.C | Loading commit data... | |
| tls-1.C | Loading commit data... | |
| tls-2.C | Loading commit data... | |
| tls-3.C | Loading commit data... | |
| tls-4.C | Loading commit data... | |
| tls-5.C | Loading commit data... | |
| tls-template1.C | Loading commit data... | |
| tls-wrap1.C | Loading commit data... | |
| tls-wrap2.C | Loading commit data... | |
| tls-wrap3.C | Loading commit data... | |
| tls-wrap4.C | Loading commit data... | |
| tls-wrapper-cse.C | Loading commit data... | |
| tpl-atomic-1.C | Loading commit data... | |
| tpl-atomic-2.C | Loading commit data... | |
| tpl-barrier-1.C | Loading commit data... | |
| tpl-for-1.C | Loading commit data... | |
| tpl-for-2.C | Loading commit data... | |
| tpl-for-3.C | Loading commit data... | |
| tpl-master-1.C | Loading commit data... | |
| tpl-parallel-1.C | Loading commit data... | |
| tpl-parallel-2.C | Loading commit data... | |
| tpl-target-update.C | Loading commit data... | |
| udr-1.C | Loading commit data... | |
| udr-2.C | Loading commit data... | |
| udr-3.C | Loading commit data... | |
| udr-4.C | Loading commit data... | |
| udr-5.C | Loading commit data... | |
| udr-6.C | Loading commit data... |