Commit 8a20d031 by Ville Voutilainen Committed by Ville Voutilainen

re PR c++/85254 (boost::is_final does not work for template types)

PR c++/85254

gcc/cp

PR c++/85254
* class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.

testsuite/

PR c++/85254
* g++.dg/ext/is_final.C: Amend.

From-SVN: r271835
parent ceedc635
2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
gcc/cp
PR c++/85254
* class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
testsuite/
PR c++/85254
* g++.dg/ext/is_final.C: Amend.
2019-05-31 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (IDENTIFIER_LAMBDA_P): New.
......
......@@ -1907,6 +1907,7 @@ fixup_type_variants (tree t)
= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t);
TYPE_POLYMORPHIC_P (variants) = TYPE_POLYMORPHIC_P (t);
CLASSTYPE_FINAL (variants) = CLASSTYPE_FINAL (t);
TYPE_BINFO (variants) = TYPE_BINFO (t);
......
......@@ -43,3 +43,17 @@ static_assert( __is_final (Ff<int>), "Ff<int> is final" );
static_assert( __is_final (Ff<A>), "Ff<A> is final" );
static_assert( __is_final (Ff<Af>), "Ff<Af> is final" );
// PR 85254
template <class T> struct final_trait_wrap{ typedef T type; };
template <class T> struct my_is_final
{
static const bool value = __is_final(typename final_trait_wrap<T>::type);
};
struct final1 final {};
template <typename T> struct final2 final {};
static_assert( my_is_final<final1>::value, "final1 is final" );
static_assert( my_is_final<final2<int>>::value, "final2<int> is final" );
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