Skip to content

Commit 693f011

Browse files
committed
tests...
1 parent ddd8a5c commit 693f011

File tree

1 file changed

+8
-2
lines changed
  • clang-tools-extra/test/clang-tidy/checkers/modernize

1 file changed

+8
-2
lines changed

clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ typedef int I, &LVal, &&RVal, *Ptr, *const ConstPtr, Vec3[3], Fn(), (*FnPtr)();
113113
// CHECK-FIXES-NEXT: using Ptr = I *;
114114
// CHECK-FIXES-NEXT: using ConstPtr = I *const;
115115
// CHECK-FIXES-NEXT: using Vec3 = I[3];
116-
// CHECK-FIXES-NEXT: using Fn = I ();
116+
// CHECK-FIXES-NEXT: using Fn = I();
117117
// CHECK-FIXES-NEXT: using FnPtr = I (*)();
118118

119119
#define CODE typedef int INT
@@ -413,7 +413,13 @@ typedef int* IntPtr, *AlsoIntPtr;
413413
// CHECK-MESSAGES: :[[@LINE-2]]:20: warning: use 'using' instead of 'typedef' [modernize-use-using]
414414
// CHECK-FIXES: using IntPtr = int*;
415415
// CHECK-FIXES-NEXT: using AlsoIntPtr = IntPtr *;
416-
// FIXME: the second fixit is wrong. This is issue #150276.
416+
// FIXME: the second fix-it is wrong. This is issue #150276.
417+
418+
typedef int (FnWithRedundantParens)();
419+
// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
420+
// CHECK-FIXES: using FnWithRedundantParens = int ()();
421+
// FIXME: that fix-it makes the code ill-formed. The redundant parentheses need to be removed,
422+
// i.e., it should be 'using FnWithRedundantParens = int ()'. It's not a pressing issue though.
417423

418424
#ifndef SpecialMode
419425
#define SomeMacro(x) x

0 commit comments

Comments
 (0)