Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void S::x(int i = 12) {}
int main() {
S s;
s.x();
// CHECK-NOTES: [[@LINE-1]]:3: warning: calling a function that uses a default argument is disallowed [fuchsia-default-arguments-calls]
// CHECK-NOTES: [[@LINE-1]]:5: warning: calling a function that uses a default argument is disallowed [fuchsia-default-arguments-calls]
// CHECK-NOTES: [[@LINE-6]]:11: note: default parameter was declared here
// CHECK-NEXT: void S::x(int i = 12) {}
x();
Expand Down
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ Bug Fixes to Compiler Builtins

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

- Fix ``__builtin_source_location`` incorrectly returning wrong column for method chains. (#GH119129)

Bug Fixes to Attribute Support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5948,7 +5948,7 @@ Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn,
SmallVector<Expr *, 8> AllArgs;
VariadicCallType CallType = getVariadicCallType(FDecl, Proto, Fn);

Invalid = GatherArgumentsForCall(Call->getBeginLoc(), FDecl, Proto, 0, Args,
Invalid = GatherArgumentsForCall(Call->getExprLoc(), FDecl, Proto, 0, Args,
AllArgs, CallType);
if (Invalid)
return true;
Expand Down
18 changes: 18 additions & 0 deletions clang/test/SemaCXX/source_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,3 +1012,21 @@ int h = Var<int>;


}

namespace GH119129 {
struct X{
constexpr int foo(std::source_location loc = std::source_location::current()) {
return loc.line();
}
};
static_assert(X{}.foo() == __LINE__);
static_assert(X{}.
foo() == __LINE__);
static_assert(X{}.


foo() == __LINE__);
#line 10000
static_assert(X{}.
foo() == 10001);
}
Loading