<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - clang-cl does not evaluate arguments left-to-right in initializer-list constructor call"
   href="https://llvm.org/bugs/show_bug.cgi?id=31831">31831</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl does not evaluate arguments left-to-right in initializer-list constructor call
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows 2000
          </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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>13707
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For example:

  int f();
  int g();
  int h();

  struct Base {
    Base(int a, int b, int c);
  };

  struct Derived : public Base {
    Derived();
  };

  Derived::Derived() : Base{f(), g(), h()} {}


MSVC: (<a href="https://godbolt.org/g/7T91wC">https://godbolt.org/g/7T91wC</a>)
f(), g(), h()

clang-cl: (<a href="https://godbolt.org/g/Xmb51J">https://godbolt.org/g/Xmb51J</a>)
h(), g(), f()

clang linux: (<a href="https://godbolt.org/g/5aFLCF">https://godbolt.org/g/5aFLCF</a>)
f(), g(), h()


This came up in Chromium recently, where some new code relies on using
initializer lists to force the order of evaluation.</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>