http://llvm.org/bugs/show_bug.cgi?id=11832
Bug #: 11832
Summary: clang crashes with std::initializer_list<const char*>
in non-static function
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Created attachment 7928
--> http://llvm.org/bugs/attachment.cgi?id=7928
Complete crash log
The following program crashes clang r148686:
namespace std {
typedef unsigned long size_t;
// Reduced from libc++
template<class _Ep>
class initializer_list
{
// Comment these two lines to avoid the crash
const _Ep* __begin_;
size_t __size_;
inline
initializer_list(const _Ep* __b, size_t __s) noexcept
{}
public:
};
}
//#define STATIC static // Does not crash clang
#define STATIC // Crashes clang
void foo(std::initializer_list<const char*>);
STATIC void bar()
{
foo({ "foo" });
}
STATIC void baz(const char* s)
{
foo({ s });
}
This results in (full log attached):
$ ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++0x -v clang.cpp
[...]
Assertion failed: (getOperand(0)->getType() ==
cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a
pointer to Val type!"), function AssertOK, file
/Users/rynnsauer/LLVM/llvm/lib/VMCore/Instructions.cpp, line 1082.
[...]
Interestingly, it does not crash if (a) the calling functions are static, or
(b) std::initializer_list has no members.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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