File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ Improvements to Clang's diagnostics
418418- The warning for an unsupported type for a named register variable is now phrased ``unsupported type for named register variable ``,
419419 instead of ``bad type for named register variable ``. This makes it clear that the type is not supported at all, rather than being
420420 suboptimal in some way the error fails to mention (#GH111550).
421-
421+
422422- Clang now emits a ``-Wdepredcated-literal-operator `` diagnostic, even if the
423423 name was a reserved name, which we improperly allowed to suppress the
424424 diagnostic.
@@ -537,6 +537,7 @@ Bug Fixes to C++ Support
537537 certain situations. (#GH47400), (#GH90896)
538538- Fix erroneous templated array size calculation leading to crashes in generated code. (#GH41441)
539539- During the lookup for a base class name, non-type names are ignored. (#GH16855)
540+ - Fix a crash when recovering an invalid expression involving an explicit object member conversion operator. (#GH112559)
540541
541542Bug Fixes to AST Handling
542543^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1989,7 +1989,7 @@ Expr *CastExpr::getSubExprAsWritten() {
19891989 SubExpr = IgnoreExprNodes (cast<CXXConstructExpr>(SubExpr)->getArg (0 ),
19901990 ignoreImplicitSemaNodes);
19911991 } else if (E->getCastKind () == CK_UserDefinedConversion) {
1992- assert ((isa<CXXMemberCallExpr>(SubExpr) || isa< BlockExpr>(SubExpr)) &&
1992+ assert ((isa<CallExpr, BlockExpr>(SubExpr)) &&
19931993 " Unexpected SubExpr for CK_UserDefinedConversion." );
19941994 if (auto *MCE = dyn_cast<CXXMemberCallExpr>(SubExpr))
19951995 SubExpr = MCE->getImplicitObjectArgument ();
Original file line number Diff line number Diff line change @@ -1097,3 +1097,20 @@ struct C4 {
10971097 // expected-warning {{volatile-qualified parameter type 'const volatile C4' is deprecated}}
10981098};
10991099}
1100+
1101+
1102+ namespace GH112559 {
1103+ struct Wrap {};
1104+ struct S {
1105+ constexpr operator Wrap (this const S& self) {
1106+ return Wrap{};
1107+ };
1108+ constexpr int operator <<(this Wrap self, int i) {
1109+ return 0 ;
1110+ }
1111+ };
1112+ // Purposefully invalid expression to check an assertion in the
1113+ // expression recovery machinery.
1114+ static_assert ((S{} << 11 ) == a);
1115+ // expected-error@-1 {{use of undeclared identifier 'a'}}
1116+ }
You can’t perform that action at this time.
0 commit comments