* C++ PATCH for c++/57825 (ref-qualifier lost on template argument)
@ 2013-08-07 1:17 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2013-08-07 1:17 UTC (permalink / raw)
To: gcc-patches List
[-- Attachment #1: Type: text/plain, Size: 74 bytes --]
Simple oversight.
Tested x86_64-pc-linux-gnu, applying to trunk and 4.8.
[-- Attachment #2: 57825.patch --]
[-- Type: text/x-patch, Size: 1237 bytes --]
commit e468033b49ddb6cadfd3c07d3ac0b81d80bc523a
Author: Jason Merrill <jason@redhat.com>
Date: Tue Aug 6 19:49:40 2013 -0400
PR c++/57825
* tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index f8b4bbc..63ec7fa 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1236,6 +1236,8 @@ strip_typedefs (tree t)
result =
build_method_type_directly (class_type, type,
TREE_CHAIN (arg_types));
+ result
+ = build_ref_qualified_type (result, type_memfn_rqual (t));
}
else
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C
new file mode 100644
index 0000000..8e55551
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C
@@ -0,0 +1,18 @@
+// PR c++/57825
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct target_class
+{};
+
+template<typename Class, typename Ret, typename... Args>
+struct target_class<Ret (Class::*)(Args...)>
+{};
+
+template<typename Class, typename Ret, typename... Args>
+struct target_class<Ret (Class::*)(Args...) &>
+{};
+
+template<typename Class, typename Ret, typename... Args>
+struct target_class<Ret (Class::*)(Args...) &&>
+{};
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-08-07 1:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-07 1:17 C++ PATCH for c++/57825 (ref-qualifier lost on template argument) Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).