Opened 7 years ago

Last modified 7 years ago

#11986 new Bugs

TTI: has_static_member_function doesn't like function local classes with GCC

Reported by: lukester_null@… Owned by: Edward Diener
Milestone: To Be Determined Component: tti
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description

Hi

Not sure if this expected or known or impossible to fix, but it seems has_static_member_function doesn't work with function scope local classes in GCC (or clang; it's OK in VC++).

Personally, I only tripped over it writing a test so the fix was simple (no function scope class) but I thought best to report it.

Thanks

Luke Elliott.

#include <boost/tti/has_static_member_function.hpp>
#include <boost/static_assert.hpp>

BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(StaticFunction)

int main()
{
    class Nested
    {
    public:
        static void StaticFunction()
        {
        }
    };
    BOOST_STATIC_ASSERT_MSG((has_static_member_function_StaticFunction<Nested, void ()>::value), "That's not gone well.");
}

Change History (1)

comment:1 by Edward Diener, 7 years ago

Thanks for reporting this. I will take a look at this and try to determine why it is failing.

Note: See TracTickets for help on using tickets.