https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79702

            Bug ID: 79702
           Summary: AX_CXX_COMPILE_STDCXX([17]) does not work with
                    GCC=7.0.1
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kreckel at ginac dot de
  Target Milestone: ---

This program is reduced from the C++17 conftest produced by the macro from
https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html:

#include <utility>

struct S
{
  int x1 : 2;
  volatile double y1;
};

S f3()
{
  return {};
}

const auto [ x3, y3 ] = f3();

It fails to compile with g++ 7.0.1 20170205 on x86_64-pc-linux-gnu:
$ g++ -std=c++17 -c conftest.cpp 
conftest.cpp:14:12: error: 'std::tuple_size<const S>::value' is not an integral
constant expression
 const auto [ x3, y3 ] = f3();
            ^~~~~~~~~~

The error has something to do with <utility>, as it goes away if I comment out
the #include directive.

Reply via email to