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
+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.
= 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);
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" );