Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2023-02-27 15:57:44


Daniela Engert wrote:
> The repro is simple: create an otherwise empty TU with just "#include
> <boost/log/sinks.hpp>" in it and compile. Our build system emits this compiler
> invocation:
>
> C:\Program Files\Microsoft Visual
> Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\CL
> .exe /c /Zi /JMC /nologo /W4 /WX /diagnostics:caret /MP /Od /Ob1 /Oi /D
> QT_STATIC /D __QT6__ /D _UNICODE /D UNICODE /Zc:preprocessor /Gm-
> /EHsc /RTC1 /MDd /GS /arch:AVX2 /fp:fast /Zc:wchar_t /Zc:forScope
> /Zc:inline /Zc:rvalueCast /std:c++latest /permissive- /Fo"x64\Debug\\"
> /Fd"E:\HWPA\lib64\Debug\libEnvironment.pdb" /external:W4 /Gd /TP /FC
> /errorReport:prompt /Zc:checkGwOdr /Zc:templateScope
> /Zc:externConstexpr /Zc:__cplusplus /utf-8 /Zc:throwingNew /Zc:strictStrings
> /bigobj Log.cpp

The culprit here is /Zc:templateScope. This is not set by default (and I don't
see it in the IDE at all), and there's no error without it. (/permissive- is also
required for the error.)

https://learn.microsoft.com/en-us/cpp/build/reference/zc-templatescope?view=msvc-170

"The /Zc:templateScope option is new in Visual Studio 2022 version 17.5
preview 1. The option is off by default even when the code is compiled
using the /permissive- option (or an option that implies /permissive-,
such as /std:c++20 or /std:c++latest)."


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk