summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-01 03:33:19 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-01 03:33:19 +0000
commit346e3a9c85f2878a54745f5065eb84eeeaed12f5 (patch)
tree4df2798ed30c19a13c03271ee6b5b653821b5353 /gcc/cp/decl.c
parente69b1b1e69432a889150d153f994e58419cf5be6 (diff)
downloadgcc-346e3a9c85f2878a54745f5065eb84eeeaed12f5.tar.gz
Implement late-specified return type using 'auto'.
* cp-tree.h (struct cp_declarator): Add late_return_type field to function declarator. * parser.c (cp_parser_late_return_type_opt): New fn. (cp_parser_direct_declarator): Use it. (make_call_declarator): Put it in the declarator. * decl.c (grokdeclarator): Splice in late-specified return type. * pt.c (splice_late_return_type): New fn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139848 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5a5a41fd30a..0d735c4683f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8220,6 +8220,12 @@ grokdeclarator (const cp_declarator *declarator,
/* Pick up the exception specifications. */
raises = declarator->u.function.exception_specification;
+ /* Handle a late-specified return type. */
+ type = splice_late_return_type
+ (type, declarator->u.function.late_return_type);
+ if (type == error_mark_node)
+ return error_mark_node;
+
/* Say it's a definition only for the CALL_EXPR
closest to the identifier. */
funcdecl_p = inner_declarator && inner_declarator->kind == cdk_id;