<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 - [CLANG][warnings] With -Wextra the compiler should emit a warning when enumerator and non-enumerator both appear in conditional expression"
   href="https://bugs.llvm.org/show_bug.cgi?id=37810">37810</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[CLANG][warnings] With -Wextra the compiler should emit a warning when enumerator and non-enumerator both appear in conditional expression
          </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>Frontend
          </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>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If extra warnings are enabled ( -Wall is passed as input to clang)
the compiler should warn when a enumerator and a non-enumerator both appear in
a conditional
expression.

Given the following example:

////////////////////////////
enum E { A, B };
int f1(void *p) {
  float x=0;
  x += (p!=0) ? 2.0: B;
  return x;
}
///////////////////////////

$clang test.cpp -Wall -c
  // No warnings generated.

$clang test.cpp -Wall -Wextra -c
  // No warnings generated.

While

$g++ test.cpp -Wall -c
  // No warnings generated.

$g++ test.cpp -Wall -Wextra -c
test.cpp: In function ‘int f1(void*)’:
test.cpp:5: warning: enumeral and non-enumeral type in conditional expression</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>