Assertion `(Encoding == dwarf::DW_ATE_unsigned || ... ' with nullptr
| Bugzilla Link | 21875 |
| Resolution | FIXED |
| Resolved on | Dec 16, 2014 18:44 |
| Version | trunk |
| OS | Linux |
| CC | @dwblaikie,@echristo |
Extended Description
// The following source gets an assertion at // lib/CodeGen/AsmPrinter/DwarfUnit.cpp:783 with // clang -cc1 -g -triple x86_64-unknown-linux-gnu -emit-obj -std=c++11:
template<class T, T t> void f() {} typedef decltype(nullptr) nullptr_t; template <> void f<nullptr_t, nullptr>() {}
/* llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:783: bool isUnsignedDIType(llvm::DwarfDebug*, llvm::DIType): Assertion `(Encoding == dwarf::DW_ATE_unsigned || Encoding == dwarf::DW_ATE_unsigned_char || Encoding == dwarf::DW_ATE_signed || Encoding == dwarf::DW_ATE_signed_char || Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean) && "Unsupported encoding"' failed. */
GCC produced a DW_TAG_template_value_parameter with const_value of data1 0. udata 0 seems appropriate (as we do for null valued pointer typed non-type template parameters), so I implemented that in r224399.
Interesting. I'm pretty sure that we shouldn't be adding the nullptr as a constant of value 0 when creating the template parameter.