From 18dc5657de4d850295c3c8662520b256b00ce1af Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 13 May 2013 15:32:22 -0400 Subject: [PATCH] re PR c++/57253 (GCC ignores ref-qualifiers of pseudo-function types in explicit specializations) PR c++/57253 * decl.c (grokdeclarator): Apply ref-qualifier in the TYPENAME case. From-SVN: r198842 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 2 +- gcc/testsuite/g++.dg/cpp0x/ref-qual11.C | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/ref-qual11.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eab529a1831..e1eda6a0fad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2013-05-13 Jason Merrill + PR c++/57253 + * decl.c (grokdeclarator): Apply ref-qualifier + in the TYPENAME case. + PR c++/57252 * decl.c (decls_match): Compare ref-qualifiers. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0df3ae86a29..67e67e6079f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10284,7 +10284,7 @@ grokdeclarator (const cp_declarator *declarator, type = void_type_node; } } - else if (memfn_quals) + else if (memfn_quals || rqual) { if (ctype == NULL_TREE && TREE_CODE (type) == METHOD_TYPE) diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual11.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual11.C new file mode 100644 index 00000000000..15dd049f22a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual11.C @@ -0,0 +1,10 @@ +// PR c++/57253 +// { dg-require-effective-target c++11 } + +template struct foo; + +template<> struct foo {}; +template<> struct foo {}; + +int main() +{} -- 2.30.2