Commit 4fdfdd4f by Jason Merrill Committed by Jason Merrill

DR 1558 PR c++/67021

	DR 1558
	PR c++/67021
	* pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.

From-SVN: r226381
parent 2d590ab0
2015-07-30 Jason Merrill <jason@redhat.com>
DR 1558
PR c++/67021
* pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.
2015-07-28 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (build_op_delete_call, convert_like_real, build_over_call):
......
......@@ -11570,6 +11570,10 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
{
DECL_ORIGINAL_TYPE (r) = NULL_TREE;
set_underlying_type (r);
if (TYPE_DECL_ALIAS_P (r) && type != error_mark_node)
/* An alias template specialization can be dependent
even if its underlying type is not. */
TYPE_DEPENDENT_P_VALID (TREE_TYPE (r)) = false;
}
layout_decl (r, 0);
......
// PR c++/67021
// { dg-do compile { target c++11 } }
template<typename> struct Dummy;
template<> struct Dummy<int> {};
template <class...>
struct all_same { static constexpr bool value = true; };
template <class T, class...Rest>
struct all_same<T, T, Rest...> : all_same<T, Rest...> {};
template <class T, class U, class...Rest>
struct all_same<T, U, Rest...> { static constexpr bool value = false; };
template <class R>
using ValueType = int;
template <class I>
constexpr bool A(I i) {
return all_same<ValueType<I>, ValueType<decltype(i++)>>::value;
}
int main() {
static_assert(A(42), "");
}
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