diff options
author | Jason Merrill <jason@redhat.com> | 2013-02-13 23:31:03 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-02-13 23:31:03 -0500 |
commit | 28d5c77761402501ed6604c581d27410c22bbf4b (patch) | |
tree | 960f8051efbc2d97fd7fe86673dfbc25990d1818 | |
parent | e75e98f270478aca1c8c823171e8d29d471bfc87 (diff) | |
download | gcc-28d5c77761402501ed6604c581d27410c22bbf4b.zip gcc-28d5c77761402501ed6604c581d27410c22bbf4b.tar.gz gcc-28d5c77761402501ed6604c581d27410c22bbf4b.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/parser.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/nsdmi8.C | 8 |
3 files changed, 13 insertions, 0 deletions
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 <jason@redhat.com> + 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 <class T> using F = T; +struct X { + F<void ()>* fp = nullptr; +}; +int main () { return 0; } |