Issue |
143711
|
Summary |
Wrong source range for CXXTemporaryObjectExpr
|
Labels |
clang:frontend
|
Assignees |
|
Reporter |
tJener
|
See https://godbolt.org/z/6cdcj1qqY
```c++
struct S {
S(int, int);
};
void f() {
S(S(0, 1));
}
```
When the `CXXTemporaryObjectExpr` is wrapped with a `CXXFunctionalCastExpr`, the source range of the `CXXTemporaryObjectExpr` contains the closing parenthesis of the `CXXFunctionalCastExpr`.
This occurs starting in `-std=c++17`, where guaranteed copy elision is in effect. In C++14, there is an intervening `CXXConstructExpr` and the `CXXTemporaryObjectExpr` has the correct source range (although Compiler Explorer's highlighting of AST nodes includes the closing parenthesis, as if `))` was a single token).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs