Closed
Description
Originally reported in #91879 (comment)
After #91879, unreachable calls to constructors with default parameters set to builtins would underline the builtin as the source range instead of the call to the constructor - e.g.
struct A {
explicit A(int = __builtin_LINE());
};
int h(int a) {
return 3;
A();
}
used to produce the diagnostic
<source>:7:3: error: code will never be executed [-Werror,-Wunreachable-code]
7 | A();
| ^~~
but now produces the (incorrect) diagnostic
2 | explicit A(int = __builtin_LINE());
| ^~~~~~~~~~~~~~~~
godbolt: https://godbolt.org/z/6TEdrx55d