diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-17 10:29:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-17 10:29:46 +0000 |
commit | f330f5991ef0182d59ab6b5b1c31f3bd5cb125ee (patch) | |
tree | 247bd596522541b9f25d331d9ad58d61511c320d /gcc/cp/decl2.c | |
parent | 5264f487f03c0e89c258c62ba2ebe8b46fc189ac (diff) | |
download | gcc-f330f5991ef0182d59ab6b5b1c31f3bd5cb125ee.tar.gz |
re PR c++/44516 (improve error message when no matching operator)
gcc/cp
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44516
* typeck.c (build_x_array_ref, build_x_conditional_expr,
build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
(finish_class_member_access_expr, build_x_indirect_ref,
build_x_binary_op, build_x_compound_expr_from_list,
build_x_compound_expr_from_vec): Adjust callers.
* tree.c (build_min_nt_loc): New.
(build_min_nt): Remove.
* typeck2.c (build_x_arrow): Adjust callers.
* pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
tsubst_copy_and_build): Likewise.
* semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
finish_omp_atomic): Likewise.
* decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
* parser.c (cp_parser_question_colon_clause,
cp_parser_assignment_expression, cp_parser_expression,
cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
* cp-tree.h: Update.
gcc/testsuite
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44516
* g++.dg/parse/error48.C: New.
* g++.dg/template/crash89.C: Adjust dg-error line numbers.
* g++.old-deja/g++.robertl/eb109.C: Add column info to dg-error string.
libstdc++
2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44516
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust
dg-error line number.
From-SVN: r187627
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index aa2324ec784..c40b830a1aa 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -350,8 +350,8 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp) { if (type_dependent_expression_p (array_expr) || type_dependent_expression_p (index_exp)) - return build_min_nt (ARRAY_REF, array_expr, index_exp, - NULL_TREE, NULL_TREE); + return build_min_nt_loc (loc, ARRAY_REF, array_expr, index_exp, + NULL_TREE, NULL_TREE); array_expr = build_non_dependent_expr (array_expr); index_exp = build_non_dependent_expr (index_exp); } @@ -362,9 +362,8 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp) /* If they have an `operator[]', use that. */ if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp))) - expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, - array_expr, index_exp, NULL_TREE, - /*overload=*/NULL, tf_warning_or_error); + expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, array_expr, index_exp, + NULL_TREE, /*overload=*/NULL, tf_warning_or_error); else { tree p1, p2, i1, i2; @@ -1370,8 +1369,8 @@ build_anon_union_vars (tree type, tree object) permerror (input_location, "protected member %q+#D in anonymous union", field); if (processing_template_decl) - ref = build_min_nt (COMPONENT_REF, object, - DECL_NAME (field), NULL_TREE); + ref = build_min_nt_loc (UNKNOWN_LOCATION, COMPONENT_REF, object, + DECL_NAME (field), NULL_TREE); else ref = build_class_member_access_expr (object, field, NULL_TREE, false, tf_warning_or_error); |