From: Jason Merrill Date: Thu, 14 Feb 2013 04:31:03 +0000 (-0500) Subject: re PR c++/55670 ([C++11] This isn't a pure virtual method.) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28d5c77761402501ed6604c581d27410c22bbf4b;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d28a6049a81..033aa1ec066 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 402f384102b..d18e0278cde 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 00000000000..f89bec6d167 --- /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; }