aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-09-24 22:26:01 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-09-24 22:26:01 -0400
commiteb02633818a908b78e8fc0939be2e4774ed840c6 (patch)
tree4ed25f3377c184a6d3a1db8397675121388b3ccc /gcc/cp/decl2.c
parent0e5f8a598de1c8dc44fb59c6d0ea0dcd557f695a (diff)
downloadgcc-eb02633818a908b78e8fc0939be2e4774ed840c6.zip
gcc-eb02633818a908b78e8fc0939be2e4774ed840c6.tar.gz
gcc-eb02633818a908b78e8fc0939be2e4774ed840c6.tar.bz2
Handle deferred parsing of NSDMIs.
* parser.h (cp_unparsed_functions_entry): Add nsdmis field. * parser.c (unparsed_nsdmis, cp_parser_save_nsdmi): New. (cp_parser_late_parse_one_default_arg): Split out from cp_parser_late_parsing_default_args. (cp_parser_late_parsing_nsdmi): New. (push_unparsed_function_queues): Set it. (cp_parser_parameter_declaration): Save the '=' token. (cp_parser_template_parameter): Likewise. (cp_parser_default_argument): Call cp_parser_initializer rather than cp_parser_initializer_clause. (cp_parser_class_specifier_1): Parse unparsed_nsdmis. (cp_parser_member_declaration): Handle nsdmis. * decl2.c (grokfield): Handle DEFAULT_ARG for a function. From-SVN: r179156
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 1e06280..6e5f7cc 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -902,6 +902,8 @@ grokfield (const cp_declarator *declarator,
DECL_DECLARED_INLINE_P (value) = 1;
}
}
+ else if (TREE_CODE (init) == DEFAULT_ARG)
+ error ("invalid initializer for member function %qD", value);
else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
{
if (integer_zerop (init))