https://llvm.org/bugs/show_bug.cgi?id=24015
Bug ID: 24015
Summary: Assertion failed: (!isDependentType() && "This doesn't
make sense for dependent types"), function
isConstantSizeType
Product: clang
Version: trunk
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Created attachment 14546
--> https://llvm.org/bugs/attachment.cgi?id=14546&action=edit
Program to search for potentially constexpr VarDecls
The attached demo.cpp uses libtooling to search for "potentially constexpr"
VarDecls in code. When processing the following header-file contents:
/////////////////////////
template <typename T>
struct MyStruct {
static void f() {
unsigned AllocSize = static_cast<unsigned>(sizeof(MyStruct));
}
};
/////////////////////////
the demo program crashes with an assertion failure, apparently triggered by
calling isCXX11ConstantExpr on that static_cast expression.
Assertion failed: (!isDependentType() && "This doesn't make sense for dependent
types"), function isConstantSizeType, file
/Users/stone/llvm/tools/clang/lib/AST/Type.cpp, line 896.
0 demo 0x000000010ea27079
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 57
1 demo 0x000000010ea27c6b SignalHandler(int) + 875
2 libsystem_platform.dylib 0x00007fff992d9f1a _sigtramp + 26
3 demo 0x000000010ebffe60 nuls + 31584
4 demo 0x000000010ea27856 abort + 22
5 demo 0x000000010ea27831 __assert_rtn + 81
6 demo 0x000000010e836852
clang::Type::isConstantSizeType() const + 130
7 demo 0x000000010e784e9e HandleSizeof((anonymous
namespace)::EvalInfo&, clang::SourceLocation, clang::QualType,
clang::CharUnits&) + 126
8 demo 0x000000010e77c7ca
clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) + 6026
9 demo 0x000000010e787c5d (anonymous
namespace)::IntExprEvaluator::VisitCastExpr(clang::CastExpr const*) + 1037
10 demo 0x000000010e77b70f
clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) + 1743
11 demo 0x000000010e787926 (anonymous
namespace)::IntExprEvaluator::VisitCastExpr(clang::CastExpr const*) + 214
12 demo 0x000000010e77b70f
clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) + 1743
13 demo 0x000000010e7740ea Evaluate(clang::APValue&,
(anonymous namespace)::EvalInfo&, clang::Expr const*) + 442
14 demo 0x000000010e76ff71 EvaluateAsRValue((anonymous
namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) + 97
15 demo 0x000000010e7738ed
clang::Expr::isCXX11ConstantExpr(clang::ASTContext const&, clang::APValue*,
clang::SourceLocation*) const + 429
16 demo 0x000000010dde649c
ProcessVarDecl::run(clang::ast_matchers::MatchFinder::MatchResult const&) + 76
...
If the "template <typename T>" line is removed from the input, the demo program
runs successfully.
--
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