https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77656

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-09-20
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
template<unsigned long long N, int O = (N >> (sizeof(int) * __CHAR_BIT__))>
class A {};
template<unsigned int T> class B : A<T> {};
template<unsigned int T> class C : A<(unsigned long long) T> {};

Perhaps tsubst of TEMPLATE_PARM_INDEX instead of just
return convert_from_reference (unshare_expr (arg));
also convert it to the TEMPLATE_PARM_INDEX's type (if it is integral type only,
or when?)?

Also, is e.g.

template<unsigned short N> class A {};
A<0xffffU> a;
A<0x1ffffU> b;

valid C++11 (0x1ffffU is too large to fit into unsigned short)?  clang++
accepts it in C++98 and rejects with narrowing conversion error in -std=c++11
and later, g++ only warns:
warning: large integer implicitly truncated to unsigned type [-Woverflow]

Reply via email to