This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/59361] New: cannot expand parenthesized pack expression


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

            Bug ID: 59361
           Summary: cannot expand parenthesized pack expression
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com

The following compiles with clang but doesn't with g++ 4.8.2 with -std=gnu++11:

    template<bool ...Bs>
    struct and_ 
    {
        constexpr static bool value{true};
    };

    template<typename T>
    struct true_
    {
        constexpr operator bool() const { return true; }
    };

    template<typename ...Ts>
    constexpr bool foo(Ts...)
    {
        return and_<(true_<Ts>())...>::value;
    }

    int main()
    {
    }

The error I get is:

test.cpp: In function âconstexpr bool foo(Ts ...)â:
test.cpp:16:34: error: expected parameter pack before â...â
         return and_<(true_<Ts>())...>::value;
                                  ^
test.cpp:16:37: error: template argument 1 is invalid
         return and_<(true_<Ts>())...>::value;
                                     ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]