aboutsummaryrefslogtreecommitdiff
path: root/libcc1
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2019-12-18 19:23:01 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2019-12-18 19:23:01 +0000
commitd3769410c65a7d3f2d58402c3ecf5c253e340c2e (patch)
treeb4db956e077c48a691a959e453a8afb0aa65b4cf /libcc1
parenta7389ce5d4505a7a3596539ad3a844a850e769d4 (diff)
downloadgcc-d3769410c65a7d3f2d58402c3ecf5c253e340c2e.zip
gcc-d3769410c65a7d3f2d58402c3ecf5c253e340c2e.tar.gz
gcc-d3769410c65a7d3f2d58402c3ecf5c253e340c2e.tar.bz2
typeck.c (cxx_sizeof_or_alignof_type): Add location_t parameter and use it throughout.
/gcc/cp 2019-12-18 Paolo Carlini <paolo.carlini@oracle.com> * typeck.c (cxx_sizeof_or_alignof_type): Add location_t parameter and use it throughout. (cxx_sizeof_expr): Likewise. (cxx_alignof_expr): Likewise. (cxx_sizeof_or_alignof_expr): Likewise. (cxx_alignas_expr): Update call. * decl.c (fold_sizeof_expr): Likewise. * pt.c (tsubst_copy): Likewise. (tsubst_copy_and_build): Likewise. * except.c (build_throw): Add location_t parameter and use it. (expand_end_catch_block): Update call. * parser.c (cp_parser_unary_expression): Update cxx_sizeof_or_alignof_type and cxx_sizeof_or_alignof_expr calls, pass the compound location. (cp_parser_throw_expression): Likewise pass the combined location to build_throw. * cp-tree.h: Update declarations. * semantics.c (finish_handler_parms): Use DECL_SOURCE_LOCATION. * decl2.c (check_classfn): Likewise. * except.c (is_admissible_throw_operand_or_catch_parameter): Exploit cp_expr_loc_or_input_loc in one place. * except.c (create_try_catch_expr): Remove, unused. /libcc1 2019-12-18 Paolo Carlini <paolo.carlini@oracle.com> * libcp1plugin.cc (plugin_build_unary_expr): Update build_throw and cxx_sizeof_or_alignof_expr calls. (plugin_build_unary_type_expr): Likewise for cxx_sizeof_or_alignof_type. /gcc/testsuite 2019-12-18 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/alignof2.C: New. * g++.dg/diagnostic/alignof3.C: Likewise. * g++.dg/diagnostic/incomplete-type-1.C: Likewise. * g++.dg/warn/Wcatch-value-3b.C: Likewise. * g++.dg/cpp0x/alignof3.C: Check location(s) too. * g++.dg/cpp1z/decomp-bitfield1.C: Likewise. * g++.dg/cpp1z/has-unique-obj-representations2.C: Likewise. * g++.dg/expr/sizeof3.C: Likewise. * g++.dg/ext/flexary6.C: Likewise. * g++.dg/ext/vla4.C: Likewise. * g++.dg/template/sizeof11.C: Likewise. * g++.dg/warn/Wcatch-value-1.C: Likewise. * g++.dg/warn/Wcatch-value-2.C: Likewise. * g++.dg/warn/Wcatch-value-3.C: Likewise. * g++.old-deja/g++.brendan/sizeof1.C: Likewise. * g++.old-deja/g++.brendan/sizeof3.C: Likewise. * g++.old-deja/g++.brendan/sizeof4.C: Likewise. * g++.old-deja/g++.eh/ctor1.C: Likewise. * g++.old-deja/g++.jason/ambig1.C: Likewise. * g++.old-deja/g++.other/sizeof4.C: Likewise. From-SVN: r279543
Diffstat (limited to 'libcc1')
-rw-r--r--libcc1/ChangeLog7
-rw-r--r--libcc1/libcp1plugin.cc8
2 files changed, 12 insertions, 3 deletions
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog
index b288fc9..a56deb5 100644
--- a/libcc1/ChangeLog
+++ b/libcc1/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * libcp1plugin.cc (plugin_build_unary_expr): Update build_throw
+ and cxx_sizeof_or_alignof_expr calls.
+ (plugin_build_unary_type_expr): Likewise for
+ cxx_sizeof_or_alignof_type.
+
2019-12-09 Paolo Carlini <paolo.carlini@oracle.com>
* libcp1plugin.cc (plugin_build_cast_expr): Adjust build_cast
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index aa9844a..56eaf9b 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -2797,7 +2797,7 @@ plugin_build_unary_expr (cc1_plugin::connection *self,
break;
case THROW_EXPR:
- result = build_throw (op0);
+ result = build_throw (input_location, op0);
break;
case TYPEID_EXPR:
@@ -2806,7 +2806,8 @@ plugin_build_unary_expr (cc1_plugin::connection *self,
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
- result = cxx_sizeof_or_alignof_expr (op0, opcode, true);
+ result = cxx_sizeof_or_alignof_expr (input_location,
+ op0, opcode, true);
break;
case DELETE_EXPR:
@@ -3048,7 +3049,8 @@ plugin_build_unary_type_expr (cc1_plugin::connection *self,
default:
/* Use the C++11 alignof semantics. */
- result = cxx_sizeof_or_alignof_type (type, opcode, true, true);
+ result = cxx_sizeof_or_alignof_type (input_location, type,
+ opcode, true, true);
}
if (template_dependent_p)