From 5655267ca161de13e553dbfc0b7e58962fbb2443 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 13 Apr 2016 16:11:20 -0400 Subject: Pass empty class parameters like C. * call.c (pass_as_empty_struct, empty_class_arg): New. (type_passed_as, build_x_va_arg): Use pass_as_empty_struct. (build_call_a): Use empty_class_arg. * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New. * decl.c (cxx_init_decl_processing): Create empty_struct_type. From-SVN: r234959 --- gcc/cp/decl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/cp/decl.c') diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 380bc79..5ca426b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4180,6 +4180,10 @@ cxx_init_decl_processing (void) nullptr_node = build_int_cst (nullptr_type_node, 0); } + empty_struct_type = make_node (RECORD_TYPE); + finish_builtin_struct (empty_struct_type, "__empty_struct", + NULL_TREE, NULL_TREE); + abort_fndecl = build_library_fn_ptr ("__cxa_pure_virtual", void_ftype, ECF_NORETURN | ECF_NOTHROW); -- cgit v1.1