On 20 January 2017 at 21:32, Nico Weber <tha...@chromium.org> wrote: > This warns about code like > > constexpr int foo = 4; > [&foo]() { use(foo); } > > That's correct, but removing &foo then makes MSVC complain about this code > like "error C3493: 'foo' cannot be implicitly captured because no default > capture mode has been specified". A workaround is to make foo static const > instead of constexpr. > > This seems like an MSVC bug, but it's still a bit annoying that clang now > suggests doing things that won't build in other compilers. Any ideas what to > do about this?
Should Clang care about the behaviour of other compilers that don't follow the standard? You could: Disable the warning on the command line. Disable the warning with a pragma. Cast foo to void inside the lambda. Only capture foo when building with MSVC. Stop building with MSVC. Complain to Microsoft. -- Malcolm Parsons _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits