Commit 83059741 by Jonathan Wakely Committed by Jonathan Wakely

PR c++/80990 use cv-qualifiers in class template argument deduction

gcc/cp:

	PR c++/80990
	* pt.c (do_class_deduction): Build qualified type.

gcc/testsuite:

	PR c++/80990
	* g++.dg/cpp1z/class-deduction39.C: New.

From-SVN: r248966
parent 09a939a0
2017-06-07 Jonathan Wakely <jwakely@redhat.com>
PR c++/80990
* pt.c (do_class_deduction): Build qualified type.
2017-06-06 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (suggest_alternatives_for): Use qualified lookup
......
......@@ -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
......
2017-06-07 Jonathan Wakely <jwakely@redhat.com>
PR c++/80990
* g++.dg/cpp1z/class-deduction39.C: New.
2017-06-07 Marek Polacek <polacek@redhat.com>
PR sanitizer/80932
......
// { dg-options -std=c++1z }
template <class T> struct A { };
A<int> a;
const A c = a;
volatile A v = a;
const volatile A cv = a;
template <class,class> struct same;
template <class T> struct same<T,T> {};
same<decltype(c), const A<int>> s1;
same<decltype(v), volatile A<int>> s2;
same<decltype(cv), const volatile A<int>> s3;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment