http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49520

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-24 
10:22:03 UTC ---
It works fine if:

* the return statement is just a noexcept-expression

* the using-declaration is moved to namespace-scope

* the using-declaration is removed and the call is qualified as 'x::foo()'

or several other variations.

I can use this workaround, but IIUC it shouldn't be necessary:

namespace x { void foo(); }

template<typename T>
struct traits
{
    static constexpr bool f() { return true; }

    static constexpr bool g()
    {
        using x::foo;
        return noexcept(foo());
    }

    static constexpr bool h()
    { return f() && g(); }
};

template struct traits<int>;

Reply via email to