[LLVMbugs] [Bug 21410] New: std option leads to error if _Bool and stdbool.h are used in C++ source
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Oct 29 05:52:19 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=21410
Bug ID: 21410
Summary: std option leads to error if _Bool and stdbool.h are
used in C++ source
Product: clang
Version: 3.4
Hardware: PC
OS: NetBSD
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: r0ller at freemail.hu
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
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
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141029/f3261a7b/attachment.html>
More information about the llvm-bugs
mailing list