This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/80990] cv-qualifiers ignored in variable definition using class template argument deduction


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]