[Bug c++/86300] New: _Bool shouldn't be a keyword in C++
zhonghao at pku dot org.cn
gcc-bugzilla@gcc.gnu.org
Mon Jun 25 06:16:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86300
Bug ID: 86300
Summary: _Bool shouldn't be a keyword in C++
Product: gcc
Version: 8.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zhonghao at pku dot org.cn
Target Milestone: ---
The code is as follow:
#ifndef __clang__
typedef bool _Bool;
#endif
template<class _Iter> struct iterator_traits {
};
template<> struct iterator_traits<_Bool> {
};
g++ accepts the code, but clang++ rejects with a message:
error: use of undeclared identifier '_Bool'
template<> struct iterator_traits<_Bool> {
The code comes from https://bugs.llvm.org/show_bug.cgi?id=7388
Douglas Gregor believes that _Bool shouldn't be a keyword in C++.
More information about the Gcc-bugs
mailing list