-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed
Labels
c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partycrash-on-invalid
Description
detailed execution result on godbolt
This bug was discovered when I was studying the usage of std::destorying_delete_t
.
After removing the first parameter of a pointer type, the compiler crashes.
In the example below, std::destorying_delete_t
is simplified to struct S
for the sake of debugging.
struct S {};
struct T {
void operator delete(S) {}
};
void foo(T *t) { delete t; }
Pretty stack dump:
1. <source>:6:26: current parser token ';'
2. <source>:6:16: parsing function body 'foo'
3. <source>:6:16: in compound statement ('{}')
Crashed in function clang::Sema::ActOnCXXDelete(clang::SourceLocation, bool, bool, clang::Expr*)
when checking QualType ParamType
, which is not a pointer and its getPointeeType
returns an empty QualType.
llvm-project/clang/lib/Sema/SemaExprCXX.cpp
Lines 3883 to 3884 in 724d903
QualType ParamType = OperatorDelete->getParamDecl(0)->getType(); | |
if (!IsVirtualDelete && !ParamType->getPointeeType()->isVoidType()) { |
Metadata
Metadata
Assignees
Labels
c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partycrash-on-invalid