Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2023-02-27 13:54:13


On 2/27/23 15:55, Daniela Engert wrote:
> Am 27.02.2023 um 13:24 schrieb Andrey Semashev via Boost:
>> On 2/27/23 15:16, Glen Fernandes wrote:
>>> On Mon, Feb 27, 2023 at 6:49 AM Daniela Engert wrote:
>>>
>>> I've noticed that e.g. Boost.Log no longer compiles on msvc 19.35 (i.e.
>>> VS2022 update 5). Looking at the test matrix to figure out where the
>>> problem might lie, I couldn't find any column with the test results of
>>> *any* msvc version, lest the current one. Is there a reason for no
>>> longer running the tests with msvc compilers?
>>>
>>>
>>> I don't believe it's intentional. 
>>>
>>> Tom, do you know why the MSVC runners aren't reporting any results?
>>>  
>>> Andrey, Log does use Appveyor for MSVC testing
>>> too: https://ci.appveyor.com/project/Lastique/log
>>> <https://ci.appveyor.com/project/Lastique/log> but there's no 1935 being
>>> tested there.
>> Yes, Boost.Log is being tested on AppVeyor, and there is a VS2022 job
>> (not sure which update, though).
>>
>> Is it because of this problem?
>>
>> https://github.com/boostorg/parameter/issues/111
>>
> It's not. The error in question is
>
> phoenix\support\preprocessed\vector_10.hpp(62,1): error C7527: 'A0': a template parameter name cannot be reused within its scope
> phoenix\support\preprocessed\vector_10.hpp(62,1): error C7527: BOOST_FUSION_ADAPT_TPL_STRUCT_NO_PARTIAL(
> phoenix\support\preprocessed\vector_10.hpp(62,1): error C7527: ^
> phoenix\support\preprocessed\vector_10.hpp(66,1): message : see previous definition of 'A0'
> phoenix\support\preprocessed\vector_10.hpp(66,1): message : )
> phoenix\support\preprocessed\vector_10.hpp(66,1): message : ^
>
> BOOST_FUSION_ADAPT_TPL_STRUCT_NO_PARTIAL expands to
>
> namespace boost {
> namespace fusion {
> namespace traits {
> template <typename A0> struct tag_of<boost::phoenix::vector1<A0>> {
>   typedef struct_tag type;
> };
> template <typename A0> struct tag_of<boost::phoenix::vector1<A0> const> {
>   typedef struct_tag type;
> };
> } // namespace traits
> namespace extension {
> template <typename A0>
> struct access::struct_member<boost::phoenix::vector1<A0>, 0> {
>   typedef A0 attribute_type;
>   typedef A0 A0;
>   typedef attribute_type type;
>   template <typename Seq> struct apply {
>     typedef typename add_reference<
>         typename mpl::eval_if<is_const<Seq>, add_const<attribute_type>,
>                               mpl::identity<attribute_type>>::type>::type type;
>     constexpr static type call(Seq &seq) { return seq.a0; }
>   };
> };
> template <typename A0>
> struct struct_member_name<boost::phoenix::vector1<A0>, 0> {
>   typedef char const *type;
>   constexpr static type call() { return "a0"; }
> };
> template <typename A0>
> struct struct_size<boost::phoenix::vector1<A0>> : mpl::int_<1> {};
> template <typename A0>
> struct struct_is_view<boost::phoenix::vector1<A0>> : mpl::false_ {};
> } // namespace extension
> } // namespace fusion
> namespace mpl {
> template <typename> struct sequence_tag;
> template <typename A0> struct sequence_tag<boost::phoenix::vector1<A0>> {
>   typedef fusion::fusion_sequence_tag type;
> };
> template <typename A0> struct sequence_tag<boost::phoenix::vector1<A0> const> {
>   typedef fusion::fusion_sequence_tag type;
> };
> } // namespace mpl
> } // namespace boost
>
> The offending code is
>
> typedef A0 A0;
>
> in
>
> template <typename A0>
> struct access::struct_member<boost::phoenix::vector1<A0>, 0>
>
> I've checked this expansion on CE with e.g. gcc and it complains for the
> same reason. I suspect an obsolete workaround in one of the libs that
> 'boost/log/sinks.hpp' depends on and has now become hostile and holds
> Boost.Log ransom.

The typedef is controlled by this condition:

https://github.com/boostorg/fusion/blob/049303436c6698ac96d8a9d8edb7a727b83cf9b7/include/boost/fusion/adapted/struct/detail/adapt_base.hpp#L146

However, I cannot reproduce your error locally by building Boost.Log or
Boost.Fusion tests. Can you provide a repro, including the compiler
command line?


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