https://bugs.llvm.org/show_bug.cgi?id=40977
Bug ID: 40977
Summary: Wrong static_assert on type of
underlying_type<memory_order>
Product: libc++
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: release blocker
Priority: P
Component: All Bugs
Assignee: dav...@freebsd.org
Reporter: diogo.samp...@arm.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
Created attachment 21570
--> https://bugs.llvm.org/attachment.cgi?id=21570&action=edit
Small reproducer
In the file include/atomic
typedef enum memory_order {
memory_order_relaxed, memory_order_consume, memory_order_acquire,
memory_order_release, memory_order_acq_rel, memory_order_seq_cst
} memory_order;
static_assert((is_same<underlying_type<memory_order>::type,
unsigned>::value), "Underlying type differs from unsigned unexpectedly");
when compiling with "g++ -std=c++11 -fshort-enums"
the underlying type reduces to unsigned char, and the assert fails.
--
A quick fix would be set the last value to something that won't fit in a
uchar...
memory_order_seq_cst = 0xFFFFFFFF
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs