Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12553 closed Bugs (fixed)

set_info_rv compile error struct vs. class

Reported by: jpettiss@… Owned by: Emil Dotchevski
Milestone: To Be Determined Component: exception
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

Under Visual Studio 2010, 2012, and 2015 (but not 2008) I see the following compilation errors:

c:\vendor\boost_1_62_0\include\boost\exception\info.hpp(206) : error C4099: 'boost::exception_detail::set_info_rv' : type name first seen using 'struct' now seen using 'class'
        c:\vendor\boost_1_62_0\include\boost\exception\exception.hpp(186) : see declaration of 'boost::exception_detail::set_info_rv'
c:\vendor\boost_1_62_0\include\boost\exception\info.hpp(241) : error C4099: 'boost::exception_detail::set_info_rv<boost::throw_function>' : type name first seen using 'struct' now seen using 'class'
c:\vendor\boost_1_62_0\include\boost\exception\info.hpp(256) : error C4099: 'boost::exception_detail::set_info_rv<boost::throw_file>' : type name first seen using 'struct' now seen using 'class'
c:\vendor\boost_1_62_0\include\boost\exception\info.hpp(271) : error C4099: 'boost::exception_detail::set_info_rv<boost::throw_line>' : type name first seen using 'struct' now seen using 'class'

Indeed, on line 185 of boost/exception/exception.hpp I see this (namespace boost::exception_detail):

        template <class>
        struct set_info_rv;

And on line 205 of bost/exception/info.hpp I see this, also in the boost::exception_detail namespace:

		template <class T>
		class set_info_rv;

There is a guard above this one on line 202:

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES

Which I think explains why an old compiler like Visual Studio 2008 does not run into this.

Manually changing the affected definitions in info.hpp from class to struct fixes the problem.

I was unable to figure out how to browse current head to see if this was fixed (no Browse Source tab anymore and no obvious URLs to the Git repo on the Git wiki pages). I'm using 1.62.0.

Change History (3)

comment:1 by Emil Dotchevski, 6 years ago

Resolution: fixed
Status: newclosed

Thanks for reporting -- fixed.

comment:2 by guitar80@…, 6 years ago

Is there any way we can push these changes to the modular-boost repo? These errors are delaying my project and it doesn't seem there has been a push in 4 months. Please feel free to email me if that is easier (guitar80@…). Thanks for your help in getting this fixed!

comment:3 by Emil Dotchevski, 6 years ago

I've just merged the develop branch of the throw_exception repo and of the exception repo into master. So just pull the master branch.

Note: See TracTickets for help on using tickets.