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 @@ -419,7 +419,7 @@ Improvements to Clang's diagnostics
419
419
- The warning for an unsupported type for a named register variable is now phrased ``unsupported type for named register variable ``,
420
420
instead of ``bad type for named register variable ``. This makes it clear that the type is not supported at all, rather than being
421
421
suboptimal in some way the error fails to mention (#GH111550).
422
-
422
+
423
423
- Clang now emits a ``-Wdepredcated-literal-operator `` diagnostic, even if the
424
424
name was a reserved name, which we improperly allowed to suppress the
425
425
diagnostic.
@@ -538,6 +538,7 @@ Bug Fixes to C++ Support
538
538
certain situations. (#GH47400), (#GH90896)
539
539
- Fix erroneous templated array size calculation leading to crashes in generated code. (#GH41441)
540
540
- During the lookup for a base class name, non-type names are ignored. (#GH16855)
541
+ - Fix a crash when recovering an invalid expression involving an explicit object member conversion operator. (#GH112559)
541
542
542
543
Bug Fixes to AST Handling
543
544
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1989,7 +1989,7 @@ Expr *CastExpr::getSubExprAsWritten() {
1989
1989
SubExpr = IgnoreExprNodes (cast<CXXConstructExpr>(SubExpr)->getArg (0 ),
1990
1990
ignoreImplicitSemaNodes);
1991
1991
} else if (E->getCastKind () == CK_UserDefinedConversion) {
1992
- assert ((isa<CXXMemberCallExpr>(SubExpr) || isa< BlockExpr>(SubExpr)) &&
1992
+ assert ((isa<CallExpr, BlockExpr>(SubExpr)) &&
1993
1993
" Unexpected SubExpr for CK_UserDefinedConversion." );
1994
1994
if (auto *MCE = dyn_cast<CXXMemberCallExpr>(SubExpr))
1995
1995
SubExpr = MCE->getImplicitObjectArgument ();
Original file line number Diff line number Diff line change @@ -1097,3 +1097,20 @@ struct C4 {
1097
1097
// expected-warning {{volatile-qualified parameter type 'const volatile C4' is deprecated}}
1098
1098
};
1099
1099
}
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