Opened 9 years ago

Closed 9 years ago

#8651 closed Bugs (fixed)

Uneeded usage of namespace causes problems for the compiler

Reported by: anonymous Owned by: ebf
Milestone: To Be Determined Component: variant
Version: Boost 1.53.0 Severity: Cosmetic
Keywords: Cc: antoshkka@…

Description

using debian sid Package: libboost1.53-dev Source: boost1.53 Version: 1.53.0-5

The gcc compiler crashes using some options when compiling (dump translation unit)

Here is a small change to work around the crash :

namespace boost {

namespace detail { namespace variant {

struct variant_hasher: public boost
static_visitor<std::size_t> { template <class T> std::size_t operator()(T const& val) const { using namespace boost; hash<T> hasher; return hasher(val); } }; }}

}

It is the uneeded namespace usage that causes the problem.

see the gcc Bug 57524 - internal compiler error on dump translation unit

Change History (5)

comment:1 by James Michael DuPont <jamesmikedupont@…>, 9 years ago

Formatted code

namespace boost {

    namespace detail { namespace variant {
        struct variant_hasher: public //boost::
	static_visitor<std::size_t> {
            template <class T>
            std::size_t operator()(T const& val) const {
	      //using namespace boost;
                hash<T> hasher;
                return hasher(val);
            }
        };
    }}
}

comment:2 by Antony Polukhin, 9 years ago

Cc: antoshkka@… added

Can this error be reproduced with the following code (hash<T> is fully qualified):

namespace boost {

    namespace detail { namespace variant {
        struct variant_hasher: public boost::static_visitor<std::size_t> {
            template <class T>
            std::size_t operator()(T const& val) const {
	        boost::hash<T> hasher;
                return hasher(val);
            }
        };
    }}
}

If error is not reproduced, I'll commit fix to 1.54.0

comment:3 by James Michael DuPont <jamesmikedupont@…>, 9 years ago

That fixes the crash, thanks!

comment:4 by Antony Polukhin, 9 years ago

(In [84683]) Workaround for GCC bug (refs #8651)

comment:5 by Antony Polukhin, 9 years ago

Resolution: fixed
Status: newclosed

(In [84747]) Merge from trunk GCC workaround (fixes #8651)

Note: See TracTickets for help on using tickets.