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++.

Reply via email to