Issue 173830
Summary [clang-tidy] `modernize-use-using` generate invaild fix-its
Labels clang-tidy
Assignees
Reporter zeyi2
    `typedef char x1, (&refArray)();`

```
<source>:1:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
    1 | typedef char x1, (&refArray)();
 | ^~~~~~~~~~~~~~~
      | using x1 = char
<source>:1:16: warning: use 'using' instead of 'typedef' [modernize-use-using]
    1 | typedef char x1, (&refArray)();
      |                ^~~~~~~~~~~~~~~
2 warnings generated.
```

The fixed code won't compile:

```
<source>:2:16: error: expected ';' after alias declaration
    2 | using x1 = char, (&refArray)(); 
      |                ^
      | ;
<source>:2:20: error: a type specifier is required for all declarations
 2 | using x1 = char, (&refArray)(); 
      | ^
<source>:2:20: error: declaration of reference variable 'refArray' requires an initializer
    2 | using x1 = char, (&refArray)(); 
      | ^~~~~~~~
3 errors generated.
Compiler returned: 1
```

Godbolt: https://clang-tidy.godbolt.org/z/cs8EYKW5n
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to