aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parse.y')
-rw-r--r--gcc/cp/parse.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 37a2bb4..22b3e95 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -259,6 +259,10 @@ cp_parse_init ()
yylval is the node for the constant. */
%token CONSTANT
+/* __func__, __FUNCTION__ or __PRETTY_FUNCTION__.
+ yylval contains an IDENTIFIER_NODE which indicates which one. */
+%token VAR_FUNC_NAME
+
/* String constants in raw form.
yylval is a STRING_CST node. */
%token STRING
@@ -1556,6 +1560,12 @@ primary:
(TREE_TYPE (TREE_TYPE ($$)),
TYPE_DOMAIN (TREE_TYPE ($$)));
}
+ | VAR_FUNC_NAME
+ {
+ $$ = fname_decl (C_RID_CODE ($$), $$);
+ if (processing_template_decl)
+ $$ = build_min_nt (LOOKUP_EXPR, DECL_NAME ($$));
+ }
| '(' expr ')'
{ $$ = finish_parenthesized_expr ($2); }
| '(' expr_or_declarator_intern ')'