From 28d5c77761402501ed6604c581d27410c22bbf4b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 13 Feb 2013 23:31:03 -0500 Subject: [PATCH] re PR c++/55670 ([C++11] This isn't a pure virtual method.) PR c++/55670 * parser.c (cp_parser_member_declaration): Check the declarator form when detecting a function declaration via typedef. From-SVN: r196043 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/parser.c | 1 + gcc/testsuite/g++.dg/cpp0x/nsdmi8.C | 8 ++++++++ 3 files changed, 13 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/nsdmi8.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d28a604..033aa1e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2013-02-13 Jason Merrill + PR c++/55670 + * parser.c (cp_parser_member_declaration): Check the declarator + form when detecting a function declaration via typedef. + PR c++/55680 * pt.c (maybe_process_partial_specialization): A lambda isn't what's being specialized. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 402f384..d18e027 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -19366,6 +19366,7 @@ cp_parser_member_declaration (cp_parser* parser) if (function_declarator_p (declarator) || (decl_specifiers.type && TREE_CODE (decl_specifiers.type) == TYPE_DECL + && declarator->kind == cdk_id && (TREE_CODE (TREE_TYPE (decl_specifiers.type)) == FUNCTION_TYPE))) initializer = cp_parser_pure_specifier (parser); diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi8.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi8.C new file mode 100644 index 0000000..f89bec6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi8.C @@ -0,0 +1,8 @@ +// PR c++/55670 +// { dg-do compile { target c++11 } } + +template using F = T; +struct X { + F* fp = nullptr; +}; +int main () { return 0; } -- 2.7.4