File tree 4 files changed +25
-3
lines changed
4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,9 @@ Bug Fixes in This Version
472
472
- Clang now correctly generates overloads for bit-precise integer types for
473
473
builtin operators in C++. Fixes #GH82998.
474
474
475
+ - Fix crash when destructor definition is preceded with an equals sign.
476
+ Fixes (#GH89544).
477
+
475
478
- When performing mixed arithmetic between ``_Complex `` floating-point types and integers,
476
479
Clang now correctly promotes the integer to its corresponding real floating-point
477
480
type only rather than to the complex type (e.g. ``_Complex float / int `` is now evaluated
Original file line number Diff line number Diff line change @@ -1482,6 +1482,8 @@ class CXXTemporary {
1482
1482
// / const S &s_ref = S(); // Requires a CXXBindTemporaryExpr.
1483
1483
// / }
1484
1484
// / \endcode
1485
+ // /
1486
+ // / Destructor might be null if destructor declaration is not valid.
1485
1487
class CXXBindTemporaryExpr : public Expr {
1486
1488
CXXTemporary *Temp = nullptr ;
1487
1489
Stmt *SubExpr = nullptr ;
Original file line number Diff line number Diff line change @@ -3893,9 +3893,14 @@ namespace {
3893
3893
}
3894
3894
3895
3895
void VisitCXXBindTemporaryExpr (const CXXBindTemporaryExpr *E) {
3896
- if (E->getTemporary ()->getDestructor ()->isTrivial ()) {
3897
- Inherited::VisitStmt (E);
3898
- return ;
3896
+ // Destructor of the temporary might be null if destructor declaration
3897
+ // is not valid.
3898
+ if (const CXXDestructorDecl *DtorDecl =
3899
+ E->getTemporary ()->getDestructor ()) {
3900
+ if (DtorDecl->isTrivial ()) {
3901
+ Inherited::VisitStmt (E);
3902
+ return ;
3903
+ }
3899
3904
}
3900
3905
3901
3906
NonTrivial = true ;
Original file line number Diff line number Diff line change @@ -565,4 +565,16 @@ struct Foo : public Baz { // expected-error {{cannot override a non-deleted func
565
565
};
566
566
}
567
567
568
+ namespace GH89544 {
569
+ class Foo {
570
+ ~Foo () = {}
571
+ // expected-error@-1 {{initializer on function does not look like a pure-specifier}}
572
+ // expected-error@-2 {{expected ';' at end of declaration list}}
573
+ };
574
+
575
+ static_assert (!__is_trivially_constructible(Foo), " " );
576
+ static_assert (!__is_trivially_constructible(Foo, const Foo &), " " );
577
+ static_assert (!__is_trivially_constructible(Foo, Foo &&), " " );
578
+ } // namespace GH89544
579
+
568
580
#endif // BE_THE_HEADER
You can’t perform that action at this time.
0 commit comments