Skip to content

Commit 670da2c

Browse files
committed
not 'here' version
1 parent 79789ab commit 670da2c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3171,7 +3171,7 @@ def note_musttail_mismatch : Note<
31713171
"%diff{ (expected $ but has $)|}1,2"
31723172
"|has different return type%diff{ ($ expected but has $)|}1,2}0">;
31733173
def note_musttail_disabled_by_not_tail_called : Note<
3174-
"'not_tail_called' attribute here prevents being called as a tail call">;
3174+
"'not_tail_called' attribute prevents being called as a tail call">;
31753175
def err_musttail_callconv_mismatch : Error<
31763176
"cannot perform a tail call to function%select{| %1}0 because it uses an "
31773177
"incompatible calling convention">;

clang/lib/Sema/SemaStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {
720720
if (const FunctionDecl *CalleeDecl = CE->getDirectCallee();
721721
CalleeDecl && CalleeDecl->hasAttr<NotTailCalledAttr>()) {
722722
Diag(St->getBeginLoc(), diag::err_musttail_mismatch) << /*show-function-callee=*/true << CalleeDecl;
723-
Diag(CalleeDecl->getLocation(), diag::note_musttail_disabled_by_not_tail_called) << CalleeDecl;
723+
Diag(CalleeDecl->getLocation(), diag::note_musttail_disabled_by_not_tail_called);
724724
return false;
725725
}
726726

clang/test/Sema/attr-musttail.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %clang_cc1 -verify -fsyntax-only %s
22

3-
int __attribute__((not_tail_called)) foo1(int a) {// expected-note {{'not_tail_called' attribute here prevents being called as a tail call}}
3+
int __attribute__((not_tail_called)) foo1(int a) {// expected-note {{'not_tail_called' attribute prevents being called as a tail call}}
44
return a + 1;
55
}
66

77

88
int foo2(int a) {
99
[[clang::musttail]]
10-
return foo1(a); // expected-error {{cannot perform a tail call to function 'foo1' because its signature is incompatible with the calling function}} `note: 'not_tail_called' attribute here prevents being called as a tail call'
10+
return foo1(a); // expected-error {{cannot perform a tail call to function 'foo1' because its signature is incompatible with the calling function}}
1111
}
1212

1313
int main() {

0 commit comments

Comments
 (0)