Skip to content

Commit 07475f1

Browse files
committed
Add release note and test.
1 parent 64dcfdf commit 07475f1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ Bug Fixes to Compiler Builtins
695695

696696
- Fix ``__has_builtin`` incorrectly returning ``false`` for some C++ type traits. (#GH111477)
697697

698+
- Fix ``__builtin_source_location`` incorrectly returning wrong column for method chains. (#GH119129)
699+
698700
Bug Fixes to Attribute Support
699701
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
700702

clang/test/SemaCXX/source_location.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,3 +1012,21 @@ int h = Var<int>;
10121012

10131013

10141014
}
1015+
1016+
namespace GH119129 {
1017+
struct X{
1018+
constexpr int foo(std::source_location loc = std::source_location::current()) {
1019+
return loc.line();
1020+
}
1021+
};
1022+
static_assert(X{}.foo() == __LINE__);
1023+
static_assert(X{}.
1024+
foo() ==__LINE__);
1025+
static_assert(X{}.
1026+
1027+
1028+
foo() ==__LINE__);
1029+
#line 10000
1030+
static_assert(X{}.
1031+
foo() == 10001);
1032+
}

0 commit comments

Comments
 (0)