Issue |
95288
|
Summary |
[Clang Diagnostics] [C++] Fixit suggesting dereferencing a `T*` to call a `T` constructor should be on a seperate line
|
Labels |
clang
|
Assignees |
|
Reporter |
MitalAshok
|
https://godbolt.org/z/cTd9YMY87
```c++
struct X {
constexpr X(int) {}
};
int* p;
X x = p;
```
```c++
<source>:6:3: error: no viable conversion from 'int *' to 'X'
6 | X x = p;
| ^ ~
<source>:2:15: note: candidate constructor not viable: no known conversion from 'int *' to 'int' for 1st argument; dereference the argument with *
2 | constexpr X(int) {}
| ^ ~~~
3 | };
4 |
5 | int* p;
6 | X x = p;
| *
```
If there was more between the constructor and the initialization the fixit to add a `*` doesn't even show up.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs