From 0bec94925da0b02672d63ab40b73679298fe939d Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 22 Dec 2015 21:46:38 +0000 Subject: [PATCH] PR c++/67339 * parser.c (cp_parser_elaborated_type_specifier): Use CLASS_TYPE_P rather than check for RECORD_TYPE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231912 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 2 +- gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1d4714ac65b2..dbc7b3e80079 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-12-22 Jason Merrill + + PR c++/67339 + * parser.c (cp_parser_elaborated_type_specifier): Use CLASS_TYPE_P + rather than check for RECORD_TYPE. + 2015-12-22 Patrick Palka * pt.c (make_pack_expansion): Make sure to initialize diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c1948c463ebe..262bfb288057 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16880,7 +16880,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, { /* Indicate whether this class was declared as a `class' or as a `struct'. */ - if (TREE_CODE (type) == RECORD_TYPE) + if (CLASS_TYPE_P (type)) CLASSTYPE_DECLARED_CLASS (type) = (tag_type == class_type); cp_parser_check_class_key (tag_type, type); } diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C new file mode 100644 index 000000000000..d0ac27d893c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C @@ -0,0 +1,16 @@ +// PR c++/67339 +// { dg-do compile { target c++11 } } + +template < typename T> +struct A +{ + void foo(); + template < typename S, typename W > + using N = void (T::*)(S, W) const ; +}; + +template < typename T> +void A::foo() +{ + typename A::template N fun = &T::out; +} -- 2.47.2