Commit f74dbcec by Jason Merrill Committed by Jason Merrill

parser.c (cp_parser_primary_expression): See through explicitly scoped ALIAS_DECLs, too.

        * parser.c (cp_parser_primary_expression): See through explicitly
        scoped ALIAS_DECLs, too.

From-SVN: r61054
parent 2d2a50c3
2003-01-08 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_primary_expression): See through explicitly
scoped ALIAS_DECLs, too.
2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
* decl.c: ANSIfy function declarations.
......
......@@ -3023,14 +3023,15 @@ cp_parser_primary_expression (cp_parser *parser,
if (TREE_CODE (decl) == FIELD_DECL || BASELINK_P (decl))
*qualifying_class = parser->scope;
}
/* Resolve references to variables of anonymous unions
into COMPONENT_REFs. */
else if (TREE_CODE (decl) == ALIAS_DECL)
decl = DECL_INITIAL (decl);
else
/* Transform references to non-static data members into
COMPONENT_REFs. */
decl = hack_identifier (decl, id_expression);
/* Resolve references to variables of anonymous unions
into COMPONENT_REFs. */
if (TREE_CODE (decl) == ALIAS_DECL)
decl = DECL_INITIAL (decl);
}
if (TREE_DEPRECATED (decl))
......
// Test that anonymous unions work with explicit scope.
static union
{
int i;
};
int main()
{
return ::i;
}
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