<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 - support for GCC complex data types extension is always enabled."
   href="https://bugs.llvm.org/show_bug.cgi?id=37298">37298</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>support for GCC complex data types extension is always enabled.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>konstantin.belochapka@sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20251" name="attach_20251" title="reprodicible">attachment 20251</a> <a href="attachment.cgi?id=20251&action=edit" title="reprodicible">[details]</a></span>
reprodicible

clang with -std=c++11 option does not disable support for GCC complex data
types extensions.

-------------------------------------------------------------------------------
Compile the attached source with -std=c++14:

$clang -c -std=c++11 gcc-complex-data-extension.cpp

This produces no warnings or errors.

--------------------------------------------------------------------------------
GCC with -std=c++14 option produces the following error messages:

$gcc -c -std=c++14 gcc-complex-data-extension.cpp

gcc-complex-data-extension.cpp: In function 'int test()':
gcc-complex-data-extension.cpp:25:20: error: unable to find numeric literal
operator 'operator""i'
  cshort_t cs = 2 + 2i;
                    ^
.....

gcc-complex-data-extension.cpp:31:24: note: use -std=gnu++11 or
-fext-numeric-literals to enable
more built-in suffixes
gcc-complex-data-extension.cpp:32:26: error: unable to find numeric literal
operator 'operator""fi'
  cldouble_t cld = 8.0f + 2.1fi;
                          ^
gcc-complex-data-extension.cpp:32:26: note: use -std=gnu++11 or
-fext-numeric-literals to enable
more built-in suffixes

--------------------------------------------------------------------------------
After adding -pedantic, we can observe the following list of warnings:

$clang -c -std=c++11 -pedantic gcc-complex-data-extension.cpp

Produces the following:
gcc-complex-data-extension.cpp:25:20: warning: imaginary constants are a GNU
extension
[-Wgnu-imaginary-constant]
        cshort_t cs = 2 + 2i;
                          ^
......                              ^
gcc-complex-data-extension.cpp:32:26: warning: imaginary constants are a GNU
extension
[-Wgnu-imaginary-constant]
        cldouble_t cld = 8.0f + 2.1fi; 


$clang -c -std=gnu++11 -pedantic gcc-complex-data-extension.cpp

Produces identical list of warnings.


Conclusion:
Unlike GCC, clang when used with -std=c++11 option, does not disable GCC
complex data types extension support.</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>