Opened 13 years ago

Closed 9 years ago

#3020 closed Bugs (fixed)

warning using boost::variant<boost::mpl_::void_>

Reported by: Yun Zhang <yun.zhang@…> Owned by: Antony Polukhin
Milestone: Boost 1.56.0 Component: variant
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

Using VC8, get compile warning C4345:

\boost\variant\variant.hpp(1174) : warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized

Attachments (1)

a.cpp (177 bytes ) - added by Yun Zhang <yun.zhang@…> 13 years ago.

Download all attachments as: .zip

Change History (11)

by Yun Zhang <yun.zhang@…>, 13 years ago

Attachment: a.cpp added

comment:1 by Yun Zhang <yun.zhang@…>, 13 years ago

Component: wavevariant
Owner: changed from Hartmut Kaiser to ebf

comment:2 by Steven Watanabe, 13 years ago

You can safely ignore this warning. Basically, the compiler is issuing a warning because it is compliant, where previous versions of msvc were not.

comment:3 by Yun Zhang <yun.zhang@…>, 13 years ago

Thanks for clarifying that the code is functional.

Is there a possibility that the boost header will either suppress or avoid the warning in a later release?

comment:4 by Steven Watanabe, 13 years ago

I believe that VC9 doesn't generate this warning. It's unlikely to be suppressed in Boost in the near future, since warnings usually get low priority.

comment:5 by Steven Watanabe, 12 years ago

Resolution: wontfix
Status: newclosed

comment:6 by David Sankel <camior@…>, 12 years ago

This warning does show up in vc10. Solution would be to add a

#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4345 )
#endif

at the top of variant.hpp and

#ifdef _MSC_VER
#pragma warning( pop )
#endif

at the bottom.

comment:7 by Michael Caisse, 11 years ago

Milestone: Boost 1.40.0To Be Determined
Resolution: wontfix
Status: closedreopened
Version: Boost 1.36.0Boost 1.48.0

Please see David Sankel's comment:6 above.

Problem has resurfaced in VC10. Just love warnings letting me know that they are doing the right thing.

comment:8 by Antony Polukhin, 9 years ago

(In [85928]) Fix MSVC warning in Boost.Variant (refs #3020)

comment:9 by Antony Polukhin, 9 years ago

Owner: changed from ebf to Antony Polukhin
Status: reopenednew

comment:10 by Antony Polukhin, 9 years ago

Milestone: To Be DeterminedBoost 1.56.0
Resolution: fixed
Status: newclosed

In [86650] fix for this issue was merged to release branch.

Note: See TracTickets for help on using tickets.