diff mbox

[C++] PR 50594 (C++ front-end bits)

Message ID 4E95D899.40808@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 12, 2011, 6:12 p.m. UTC
On 10/12/2011 07:56 PM, Jason Merrill wrote:
> On 10/12/2011 09:18 AM, Paolo Carlini wrote:
>>       newattrs
>>         = build_tree_list (get_identifier ("alloc_size"),
>>                build_tree_list (NULL_TREE, integer_one_node));
>> +    extvisattr = build_tree_list (get_identifier 
>> ("externally_visible"),
>> +                  NULL_TREE);
>> +    newattrs = chainon (newattrs, extvisattr);
> Instead of chainon you could build newattrs after extvisattr with 
> tree_cons.
Yes. Like this?

Paolo.

/////////////////////

Comments

Jason Merrill Oct. 12, 2011, 6:25 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

Index: decl.c
===================================================================
--- decl.c	(revision 179859)
+++ decl.c	(working copy)
@@ -3654,7 +3654,7 @@  cxx_init_decl_processing (void)
   current_lang_name = lang_name_cplusplus;
 
   {
-    tree newattrs;
+    tree newattrs, extvisattr;
     tree newtype, deltype;
     tree ptr_ftype_sizetype;
     tree new_eh_spec;
@@ -3684,12 +3684,15 @@  cxx_init_decl_processing (void)
 
     /* Ensure attribs.c is initialized.  */
     init_attributes ();
-    newattrs
-      = build_tree_list (get_identifier ("alloc_size"),
-			 build_tree_list (NULL_TREE, integer_one_node));
+    extvisattr = build_tree_list (get_identifier ("externally_visible"),
+				  NULL_TREE);
+    newattrs = tree_cons (get_identifier ("alloc_size"),
+			  build_tree_list (NULL_TREE, integer_one_node),
+			  extvisattr);
     newtype = cp_build_type_attribute_variant (ptr_ftype_sizetype, newattrs);
     newtype = build_exception_variant (newtype, new_eh_spec);
-    deltype = build_exception_variant (void_ftype_ptr, empty_except_spec);
+    deltype = cp_build_type_attribute_variant (void_ftype_ptr, extvisattr);
+    deltype = build_exception_variant (deltype, empty_except_spec);
     push_cp_library_fn (NEW_EXPR, newtype);
     push_cp_library_fn (VEC_NEW_EXPR, newtype);
     global_delete_fndecl = push_cp_library_fn (DELETE_EXPR, deltype);