File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Expand file tree Collapse file tree 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
472472- Clang now correctly generates overloads for bit-precise integer types for
473473 builtin operators in C++. Fixes #GH82998.
474474
475+ - Fix crash when destructor definition is preceded with an equals sign.
476+ Fixes (#GH89544).
477+
475478- When performing mixed arithmetic between ``_Complex `` floating-point types and integers,
476479 Clang now correctly promotes the integer to its corresponding real floating-point
477480 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 {
14821482// / const S &s_ref = S(); // Requires a CXXBindTemporaryExpr.
14831483// / }
14841484// / \endcode
1485+ // /
1486+ // / Destructor might be null if destructor declaration is not valid.
14851487class CXXBindTemporaryExpr : public Expr {
14861488 CXXTemporary *Temp = nullptr ;
14871489 Stmt *SubExpr = nullptr ;
Original file line number Diff line number Diff line change @@ -3893,9 +3893,14 @@ namespace {
38933893 }
38943894
38953895 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+ }
38993904 }
39003905
39013906 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
565565};
566566}
567567
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+
568580#endif // BE_THE_HEADER
You can’t perform that action at this time.
0 commit comments