[PATCH] D52690: [clang-tidy] NFC use CHECK-NOTES in tests for misc-misplaced-const
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 2 04:06:47 PDT 2018
JonasToth updated this revision to Diff 167919.
JonasToth added a comment.
- use absolute line number for note
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D52690
Files:
test/clang-tidy/misc-misplaced-const.c
test/clang-tidy/misc-misplaced-const.cpp
Index: test/clang-tidy/misc-misplaced-const.cpp
===================================================================
--- test/clang-tidy/misc-misplaced-const.cpp
+++ test/clang-tidy/misc-misplaced-const.cpp
@@ -12,7 +12,8 @@
if (const cip i = 0)
;
- // CHECK-MESSAGES: :[[@LINE+1]]:16: warning: 'i' declared with a const-qualified typedef type; results in the type being 'int *const' instead of 'const int *'
+ // CHECK-NOTES: :[[@LINE+2]]:16: warning: 'i' declared with a const-qualified typedef type; results in the type being 'int *const' instead of 'const int *'
+ // CHECK-NOTES: :4:14: note: typedef declared here
if (const ip i = 0)
;
}
Index: test/clang-tidy/misc-misplaced-const.c
===================================================================
--- test/clang-tidy/misc-misplaced-const.c
+++ test/clang-tidy/misc-misplaced-const.c
@@ -14,28 +14,33 @@
// Not ok
const ip i3 = 0;
- // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: 'i3' declared with a const-qualified typedef type; results in the type being 'int *const' instead of 'const int *'
+ // CHECK-NOTES: :[[@LINE-1]]:12: warning: 'i3' declared with a const-qualified typedef type; results in the type being 'int *const' instead of 'const int *'
+ // CHECK-NOTES: :4:14: note: typedef declared here
ip const i4 = 0;
- // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: 'i4' declared with a const-qualified
+ // CHECK-NOTES: :[[@LINE-1]]:12: warning: 'i4' declared with a const-qualified
+ // CHECK-NOTES: :4:14: note: typedef declared here
const volatile ip i5 = 0;
- // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: 'i5' declared with a const-qualified typedef type; results in the type being 'int *const volatile' instead of 'const int *volatile'
+ // CHECK-NOTES: :[[@LINE-1]]:21: warning: 'i5' declared with a const-qualified typedef type; results in the type being 'int *const volatile' instead of 'const int *volatile'
+ // CHECK-NOTES: :4:14: note: typedef declared here
}
void func2(const plain_i *i1,
const cip i2,
const ip i3,
- // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: 'i3' declared with a const-qualified
+ // CHECK-NOTES: :[[@LINE-1]]:21: warning: 'i3' declared with a const-qualified
+ // CHECK-NOTES: :4:14: note: typedef declared here
const int *i4) {
}
struct S {
const int *i0;
const plain_i *i1;
const cip i2;
const ip i3;
- // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: 'i3' declared with a const-qualified
+ // CHECK-NOTES: :[[@LINE-1]]:12: warning: 'i3' declared with a const-qualified
+ // CHECK-NOTES: :4:14: note: typedef declared here
};
// Function pointers should not be diagnosed because a function
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52690.167919.patch
Type: text/x-patch
Size: 2728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181002/a814a6ac/attachment-0001.bin>
More information about the cfe-commits
mailing list