Commit 0c58da3e by Mark Mitchell Committed by Mark Mitchell

decl2.c (grokfield): Don't accept `asm' specifiers for non-static data members.

	* decl2.c (grokfield): Don't accept `asm' specifiers for
	non-static data members.

From-SVN: r38792
parent b1095f9c
2001-01-07 Mark Mitchell <mark@codesourcery.com>
* decl2.c (grokfield): Don't accept `asm' specifiers for
non-static data members.
2001-01-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2001-01-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* expr.c (cplus_expand_expr): Don't reset `target'. * expr.c (cplus_expand_expr): Don't reset `target'.
......
...@@ -1794,15 +1794,10 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist) ...@@ -1794,15 +1794,10 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
if (TREE_CODE (value) == FIELD_DECL) if (TREE_CODE (value) == FIELD_DECL)
{ {
if (asmspec) if (asmspec)
{ cp_error ("`asm' specifiers are not permitted on non-static data members");
/* This must override the asm specifier which was placed
by grokclassfn. Lay this out fresh. */
DECL_RTL (value) = NULL_RTX;
DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
}
if (DECL_INITIAL (value) == error_mark_node) if (DECL_INITIAL (value) == error_mark_node)
init = error_mark_node; init = error_mark_node;
cp_finish_decl (value, init, asmspec_tree, flags); cp_finish_decl (value, init, NULL_TREE, flags);
DECL_INITIAL (value) = init; DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1; DECL_IN_AGGR_P (value) = 1;
return value; return value;
......
// Build don't link:
// Origin: Mark Mitchell <mark@codesourcery.com>
struct S {
int i asm ("abc"); // ERROR - `asm' specifier not permitted
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment