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
794
794
Fixes (#GH87210), (GH89541).
795
795
- Clang no longer tries to check if an expression is immediate-escalating in an unevaluated context.
796
796
Fixes (#GH91308).
797
+ - Fix a crash caused by a regression in the handling of ``source_location ``
798
+ in dependent contexts. Fixes (#GH92680).
797
799
798
800
Bug Fixes to AST Handling
799
801
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -5506,6 +5506,15 @@ struct EnsureImmediateInvocationInDefaultArgs
5506
5506
// cause it to incorrectly point it to the outermost class
5507
5507
// in the case of nested struct initialization.
5508
5508
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
+ }
5509
5518
};
5510
5519
5511
5520
ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc,
Original file line number Diff line number Diff line change @@ -912,3 +912,20 @@ auto g() {
912
912
}
913
913
914
914
}
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