[Bug c++/93842] generic lambda accesses a variable with with automatic storage duration that wasn't captured by the lambda expression
kuzniar95 at o2 dot pl
gcc-bugzilla@gcc.gnu.org
Thu Feb 20 09:05:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93842
--- Comment #3 from kuzniar95 at o2 dot pl ---
@Richard Biener changing it to
char const ch = '='; // NOT OK
doesn't solve the issue. Interestingly dropping constness:
char ch = '='; // OK
works.
So we are onto something - both const and constexpr introduce some different
handling but this special behaviour changes accessibility.
I understand "different handling" when we're talking about compile-time
expressions such as using constants for array dimensions but accessibility
changes are quite suspicious.
More information about the Gcc-bugs
mailing list