This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80990] cv-qualifiers ignored in variable definition using class template argument deduction
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Jun 2017 17:30:17 +0000
- Subject: [Bug c++/80990] cv-qualifiers ignored in variable definition using class template argument deduction
- Auto-submitted: auto-generated
- References: <bug-80990-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80990
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Testing this patch:
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -25367,7 +25367,7 @@ do_class_deduction (tree ptype, tree tmpl, tree init,
int flags,
--cp_unevaluated_operand;
release_tree_vector (args);
- return TREE_TYPE (t);
+ return cp_build_qualified_type (TREE_TYPE (t), cp_type_quals (ptype));
}
/* Replace occurrences of 'auto' in TYPE with the appropriate type deduced