<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [windows-only] #include <vector> breaks structured binding for aggregated types"
   href="https://bugs.llvm.org/show_bug.cgi?id=41994">41994</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[windows-only] #include <vector> breaks structured binding for aggregated types
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++17
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>development@jordi.vilar.cat
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code, compiled with -std=c++17, fails in windows build of
clang-8, compiles correctly in linux build of the same clang version. The
diagnostics message says:
    error: cannot decompose this type; 'std::tuple_size<const
aggregated_type>::value' is not a valid integral constant expression

#include <vector>

struct aggregated_type
{
    double a, b, c, d;
};

int main(int, char**)
{
    const aggregated_type aggregate{};
    const auto&[a, b, c, d] = aggregate;
}

commenting out the #include <vector> line, compiles as expected</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>