Closed mankangustafsson closed 3 months ago
This is a general issue with the way macros parse commas as separators, not specific to structured bindings.
Wrapping the lambda in parens (()
) makes it work as intended: https://godbolt.org/z/4orodv1bq
Please re-open if that doesn't work for some reason.
Thanks for providing a clean repro, I really appreciate that.
I figured that as well that it was something with macro parsing/expansion. Thanks for the workaround suggestion, works fine.
Describe the issue
Fails to compile. See example code below with workarounds
Steps to reproduce the problem
What version of GoogleTest are you using?
c231e6f5b152029dbd5fa4a9e0c04095035aec3f
What operating system and version are you using?
Rocky 9.3
What compiler and version are you using?
gcc 13.1.1 and clang 16.0.6
What build system are you using?
make
Additional context
Known workarounds, use named lambda or use std::get instead of structured binding No response