<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - std option leads to error if _Bool and stdbool.h are used in C++ source"
   href="http://llvm.org/bugs/show_bug.cgi?id=21410">21410</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std option leads to error if _Bool and stdbool.h are used in C++ source
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>NetBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>r0ller@freemail.hu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi All,

First, to make the OS type clearer, I'm using NetBSD with minix (3.3.0) kernel.

I bumped into the problem when trying to include a C library's header which
happened to use the _Bool type in my C++ source. So I included the stdbool.h in
the C++ source. I managed to narrow down the source to this (call it test.cpp)
to reproduce the issue:

#include <stdbool.h>

int main(){
    _Bool y;
    return 0;
}

The scenarios to compile are as follows:
1) clang++ -o test test.cpp
   compiles fine
2) clang++ -std=c++98 -o test test.cpp
   error: unknown type name '_Bool'
3) clang++ -std=c++03 -o test test.cpp
   error: unknown type name '_Bool'
4) clang++ -std=c++11 -o test test.cpp
   error: unknown type name '_Bool'
5) not using stdbool.h does not help either as then even scenario 1) leads to
   the same error
6) as the least important: specifying -ansi (i.e. '89 std) gives the same error

Actually, scenario 1) works fine but I'd like to use c++11 std. Thanks for your
help in advance!

Best regards,
r0ller</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>