[Bug c++/77656] New: 64-bit integral template parameter gets incorrectly sized as 32-bits
matt at matthewfagan dot com
gcc-bugzilla@gcc.gnu.org
Tue Sep 20 05:56:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77656
Bug ID: 77656
Summary: 64-bit integral template parameter gets incorrectly
sized as 32-bits
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: matt at matthewfagan dot com
Target Milestone: ---
GCC incorrectly sizes 64-bit integer template parameters, resulting in spurious
warnings (and perhaps incorrect code generation - unable to test this part).
The following sample code demonstrates the error: (Compiled for Target:
x86_64-pc-linux-gnu)
#include <stdint.h>
template<
uint64_t _Val,
int _Val2 = (_Val >> 32)
> class Test {
};
template<uint32_t _X>
class Test2 : Test<_X> {};
template<uint32_t _X>
class Test3 : Test<(uint64_t) _X> {};
Upon compilation, Test2 produces a spurious warning, but Test3 does not.
More information about the Gcc-bugs
mailing list