<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 - Ignored initializer clause in user-defined reduction"
   href="https://bugs.llvm.org/show_bug.cgi?id=50929">50929</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Ignored initializer clause in user-defined reduction
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>Clang Compiler Support
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>emil.loevbak@kuleuven.be
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24988" name="attach_24988" title="Code reproducing the error">attachment 24988</a> <a href="attachment.cgi?id=24988&action=edit" title="Code reproducing the error">[details]</a></span>
Code reproducing the error

The code in the attached cpp file generates a compilation error under clang++
12 on Mac OS (both x86 and ARM). I, however, believe the code to be correct. It
also compiles and runs without issues under g++.

It seems that the initalizer clause is not being read by the preprocessor and
instead the private copies of the struct are being initialized with the
(non-existent) empty-brackets constructor.

Compilation command: clang++ -Xpreprocessor -fopenmp reduction.cpp

Tested compilers:

emil@serenity Downloads % clang++ -v                                    
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

emil@serenity Downloads % /usr/local/opt/llvm/bin/clang++ -v  
clang version 12.0.0
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin</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>