Closed JonathanFoo0523 closed 1 month ago
@JonathanFoo0523 is it possible to find a reproducer that doesn't use std::tie
, but instead calls some made up function, foo
or whatever, that has the appropriate signature to trigger this issue?
I wonder if it will turn out to be template-specific.
Here is a simpler reproducer:
template<typename T> void bloop(T& x) { }
struct foo {
int b : 2;
};
int main() {
const foo d = foo();
bloop(d.b);
}
The AST:
FunctionDecl 0x558b47a670d0 <line:7:1, line:10:1> line:7:5 main 'int ()'
`-CompoundStmt 0x558b47a85f00 <col:12, line:10:1>
|-DeclStmt 0x558b47a85a48 <line:8:3, col:22>
| `-VarDecl 0x558b47a671f0 <col:3, col:21> col:13 used d 'const foo':'const foo' cinit
| `-ImplicitCastExpr 0x558b47a85a30 <col:17, col:21> 'const foo':'const foo' <NoOp>
| `-CXXTemporaryObjectExpr 0x558b47a678d8 <col:17, col:21> 'foo':'foo' 'void () noexcept' zeroing
`-ExprWithCleanups 0x558b47a85ee8 <line:9:3, col:12> 'void'
`-CallExpr 0x558b47a85e90 <col:3, col:12> 'void'
|-ImplicitCastExpr 0x558b47a85e78 <col:3> 'void (*)(const short &)' <FunctionToPointerDecay>
| `-DeclRefExpr 0x558b47a85df0 <col:3> 'void (const short &)' lvalue Function 0x558b47a85ce8 'bloop' 'void (const short &)' (FunctionTemplate 0x558b47a66ce0 'bloop')
`-MaterializeTemporaryExpr 0x558b47a85ed0 <col:9, col:11> 'const short':'const short' lvalue
`-ImplicitCastExpr 0x558b47a85eb8 <col:9, col:11> 'short' <LValueToRValue>
`-MemberExpr 0x558b47a85ac8 <col:9, col:11> 'const short' lvalue bitfield .b 0x558b47a67010
`-DeclRefExpr 0x558b47a85aa8 <col:9> 'const foo':'const foo' lvalue Var 0x558b47a671f0 'd' 'const foo':'const foo'
Applying dredd to the following file
results in
which, when compile, results in error related to