You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clang-tidy check modernize-use-using (LLVM 17.0.1 and before) fails to convert typedef to a type alias when the type is implicitly forward declared. The new type alias (BPtr) is an alias for the class itself and not a pointer to the class.
Before
class A;
typedef A* APtr; // OK
typedef class A* APtr2; // OK
typedef class B* BPtr; // * missing
After
class A;
using APtr = A *; // OK
using APtr2 = class A *; // OK
using BPtr = class B; // * missing
Should be
class A;
using APtr = A *; // OK
using APtr2 = class A *; // OK
using BPtr = class B *; // * missing
The text was updated successfully, but these errors were encountered:
clang-tidy check modernize-use-using (LLVM 17.0.1 and before) fails to convert typedef to a type alias when the type is implicitly forward declared. The new type alias (BPtr) is an alias for the class itself and not a pointer to the class.
Before
class A;
typedef A* APtr; // OK
typedef class A* APtr2; // OK
typedef class B* BPtr; // * missing
After
class A;
using APtr = A *; // OK
using APtr2 = class A *; // OK
using BPtr = class B; // * missing
Should be
class A;
using APtr = A *; // OK
using APtr2 = class A *; // OK
using BPtr = class B *; // * missing
…y when it is a definition (#67639)
Fix issue 67529, [clang-tidy: modernize-use-using fails when type is
implicitly forward
declared](#67529)
The problem is that using `Lexer` to get record declaration will lose
the type information when its original type is pointer or reference.
This patch fix this problem by skip adding the tag declaration when it's
only a 'declaration' and not a 'definition'.
Co-authored-by: huqizhi <[email protected]>
clang-tidy check modernize-use-using (LLVM 17.0.1 and before) fails to convert typedef to a type alias when the type is implicitly forward declared. The new type alias (BPtr) is an alias for the class itself and not a pointer to the class.
Before
After
Should be
The text was updated successfully, but these errors were encountered: