Index: test/clang-tidy/misc-misplaced-const.c =================================================================== --- test/clang-tidy/misc-misplaced-const.c +++ test/clang-tidy/misc-misplaced-const.c @@ -14,19 +14,23 @@ // 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) { } @@ -35,7 +39,8 @@ 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 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) ; }