https://llvm.org/bugs/show_bug.cgi?id=23602
Bug ID: 23602
Summary: clang++ fails to compile libstdc++ debug/vector with
-D_GLIBCXX_DEBUG -std=c++11
Product: clang
Version: trunk
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
clang version 3.7.0 (trunk 233105)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.1.1
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.1.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Version of libstdc++:
libstdc++-devel-5.1.1-1.fc22.x86_64
Sample code:
#include <vector>
int main() {
const std::vector<int> empty_ints;
return empty_ints.size();
}
$ clang++ -D_GLIBCXX_DEBUG -std=c++11 c.cpp
c.cpp:4:26: error: default initialization of an object of const type 'const
std::vector<int>' without a user-provided default constructor
const std::vector<int> empty_ints;
^
c.cpp:4:36: note: add an explicit initializer to initialize 'empty_ints'
const std::vector<int> empty_ints;
^
{}
1 error generated.
This error does not occur if I leave out either -D_GLIBCXX_DEBUG or -std=c++11.
This also works correctly with g++ 5.1.1.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs