Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

gcc HEAD 11.0.0 20201007 (experimental)

Options
Warnings
Boost 1.73.0
C++2a
no pedantic
Raw compiler options
-Wshadow-compatible-local

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=c++2a -Wshadow-compatible-local
prog.cc: In lambda function:
prog.cc:2:20: warning: declaration of 'i' shadows a previous local [-Wshadow=compatible-local]
    2 |     int i = [](int i){ return i;}(1);
      |                ~~~~^
prog.cc:2:9: note: shadowed declaration is here
    2 |     int i = [](int i){ return i;}(1);
      |         ^
Exit Code:
1