This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] Allow inline member functions to handle __attribute__
- From: Ira Ruben <ira at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Dec 2001 14:39:02 -0800
- Subject: [C++ Patch] Allow inline member functions to handle __attribute__
While working on the __attribute__((deprecated)) patch (apparently still unreviewed) I discovered that any __attribute__ declared for a C++ inline member function was effectively being ignored. They were being properly handled by the grammar but the resulting attribute list was not being processed. The following patch corrects this. It patches start_method() which interestingly enough has a comments implying that changes made to start_method() should also be done to grokfield() and vice versa. Grokfield() does handle __attribute__ but that code was not in start_method() so I made it do the same thing as grokfield() with the attribute list.
Ira
-----------------------
2001-12-28 Ira Ruben <ira@apple.com>
Fix to assign attributes to inline member functions.
* cp/decl.c (start_method): Handle attrlist.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.844
diff -c -3 -p -r1.844 decl.c
*** decl.c 2001/12/18 13:30:29 1.844
--- decl.c 2001/12/28 22:14:02
*************** start_method (declspecs, declarator, att
*** 14177,14182 ****
--- 14177,14185 ----
if (fndecl == void_type_node)
return fndecl;
+ if (attrlist)
+ cplus_decl_attributes (&fndecl, attrlist, 0);
+
if (TREE_CODE (fndecl) != FUNCTION_DECL)
/* Not a function, tell parser to report parse error. */
return NULL_TREE;