File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,8 @@ Bug Fixes to C++ Support
794794 Fixes (#GH87210), (GH89541).
795795- Clang no longer tries to check if an expression is immediate-escalating in an unevaluated context.
796796 Fixes (#GH91308).
797+ - Fix a crash caused by a regression in the handling of ``source_location ``
798+ in dependent contexts. Fixes (#GH92680).
797799
798800Bug Fixes to AST Handling
799801^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -5506,6 +5506,15 @@ struct EnsureImmediateInvocationInDefaultArgs
55065506 // cause it to incorrectly point it to the outermost class
55075507 // in the case of nested struct initialization.
55085508 ExprResult TransformCXXThisExpr(CXXThisExpr *E) { return E; }
5509+
5510+ // Rewrite to source location to refer to the context in which they are used.
5511+ ExprResult TransformSourceLocExpr(SourceLocExpr *E) {
5512+ if (E->getParentContext() == SemaRef.CurContext)
5513+ return E;
5514+ return getDerived().RebuildSourceLocExpr(E->getIdentKind(), E->getType(),
5515+ E->getBeginLoc(), E->getEndLoc(),
5516+ SemaRef.CurContext);
5517+ }
55095518};
55105519
55115520ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc,
Original file line number Diff line number Diff line change @@ -912,3 +912,20 @@ auto g() {
912912}
913913
914914}
915+
916+ namespace GH92680 {
917+
918+ struct IntConstuctible {
919+ IntConstuctible (std::source_location = std::source_location::current());
920+ };
921+
922+ template <typename >
923+ auto construct_at (IntConstuctible) -> decltype(IntConstuctible()) {
924+ return {};
925+ }
926+
927+ void test () {
928+ construct_at<IntConstuctible>({});
929+ }
930+
931+ }
You can’t perform that action at this time.
0 commit comments