Skip to content

Commit 0565b02

Browse files
committed
[Clang][Sema] Emit noescape diagnostic with a type name instead of 0
rdar://152087076
1 parent ac8c2f1 commit 0565b02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ static void handleNoEscapeAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
13491349
if (!isValidPointerAttrType(T, /* RefOkay */ true) && !T->isRecordType()) {
13501350
S.Diag(AL.getLoc(),
13511351
diag::warn_attribute_pointer_or_reference_or_record_only)
1352-
<< AL << AL.getRange() << 0;
1352+
<< AL << AL.getRange() << T;
13531353
return;
13541354
}
13551355

clang/test/Sema/attr-noescape.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ int *global_var __attribute((noescape)); // expected-warning{{'noescape' attribu
88

99
void foo(__attribute__((noescape)) int *int_ptr,
1010
__attribute__((noescape)) int (^block)(int),
11-
__attribute((noescape)) int integer) { // expected-warning{{'noescape' attribute only applies to a pointer, reference, class, struct, or union (0 is invalid)}}
11+
__attribute((noescape)) int integer) { // expected-warning{{'noescape' attribute only applies to a pointer, reference, class, struct, or union ('int' is invalid)}}
1212
}

0 commit comments

Comments
 (0)