[Bug c++/83115] Capturing the local variable/function parameter by value generates a compilation error
alexandr.kolesov at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Nov 22 20:04:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83115
--- Comment #1 from Alexander Kolesov <alexandr.kolesov at gmail dot com> ---
The error we can see:
prog.cc: In function 'void doSomething(double)':
prog.cc:6:44: error: 'value' was not declared in this scope
[ now = std::chrono::system_clock::now(), value]{}();
^~~~~
prog.cc:6:44: error: declaration of '<typeprefixerror>value' shadows a
parameter
prog.cc:4:31: warning: unused parameter 'value' [-Wunused-parameter]
void doSomething(const double value)
~~~~~~~~~~~~~^~~~~
More information about the Gcc-bugs
mailing list