[Bug c++/85254] boost::is_final does not work for template types

2019-10-26 Thread ville at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

--- Comment #8 from ville at gcc dot gnu.org ---
Author: ville
Date: Sat Oct 26 17:32:24 2019
New Revision: 277474

URL: https://gcc.gnu.org/viewcvs?rev=277474=gcc=rev
Log:
PR c++/85254

Backport from mainline
2019-06-01  Ville Voutilainen  

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

Modified:
branches/gcc-9-branch/gcc/cp/ChangeLog
branches/gcc-9-branch/gcc/cp/class.c
branches/gcc-9-branch/gcc/testsuite/g++.dg/ext/is_final.C

[Bug c++/85254] boost::is_final does not work for template types

2019-10-14 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |10.0

--- Comment #7 from Jason Merrill  ---
Fixed for GCC 10.

[Bug c++/85254] boost::is_final does not work for template types

2019-06-01 Thread ville at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

--- Comment #6 from ville at gcc dot gnu.org ---
Author: ville
Date: Sat Jun  1 10:57:12 2019
New Revision: 271835

URL: https://gcc.gnu.org/viewcvs?rev=271835=gcc=rev
Log:
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.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/testsuite/g++.dg/ext/is_final.C

[Bug c++/85254] boost::is_final does not work for template types

2019-05-31 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

Ville Voutilainen  changed:

   What|Removed |Added

 CC||ville.voutilainen at gmail dot 
com
   Assignee|unassigned at gcc dot gnu.org  |ville.voutilainen at 
gmail dot com

--- Comment #5 from Ville Voutilainen  ---
Mine. Patch available: https://gcc.gnu.org/ml/gcc-patches/2019-05/msg02183.html

[Bug c++/85254] boost::is_final does not work for template types

2018-05-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

--- Comment #4 from Jonathan Wakely  ---
I hoped this would fix it, but it didn't:

--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -9010,6 +9010,7 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree
type2)
   return type_code1 == ENUMERAL_TYPE;

 case CPTK_IS_FINAL:
+  type1 = TYPE_MAIN_VARIANT (type1);
   return CLASS_TYPE_P (type1) && CLASSTYPE_FINAL (type1);

 case CPTK_IS_LITERAL_TYPE:

[Bug c++/85254] boost::is_final does not work for template types

2018-04-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

--- Comment #3 from Jonathan Wakely  ---
Reduced a little further:

template  struct remove_cv{ typedef T type; };

template  struct is_final
{
  static const bool value = __is_final(typename remove_cv::type);
};

struct final1 final {};
template  struct final2 final {};

static_assert( is_final::value, "" );
static_assert( is_final::value, "" );


This should compile but fails with:

is_final_test.cpp:12:16: error: static assertion failed
 static_assert( is_final::value, "" );
^

[Bug c++/85254] boost::is_final does not work for template types

2018-04-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-04-06
 Ever confirmed|0   |1

--- Comment #2 from Jonathan Wakely  ---
Reduced to less than 30kloc

namespace boost {

   template 
   struct integral_constant
   {
  static const bool value = val;
   };

   template 
   bool const integral_constant::value;

template  struct remove_cv{ typedef T type; };

template  struct is_final
  : integral_constant<__is_final(typename remove_cv::type)> {};

}

struct final1 final {};
template  struct final2 final {};

static_assert( boost::is_final::value, "" );
static_assert( boost::is_final::value, "" );

[Bug c++/85254] boost::is_final does not work for template types

2018-04-06 Thread andysem at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85254

--- Comment #1 from andysem at mail dot ru ---
Created attachment 43869
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43869=edit
Compilable test case