<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 --- - -Wexceptions fails to emit for "will be caught by earlier handler" when using aliases"
   href="https://llvm.org/bugs/show_bug.cgi?id=28904">28904</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-Wexceptions fails to emit for "will be caught by earlier handler" when using aliases
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.8
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>bloerwald@googlemail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16911" name="attach_16911" title="reproducing source as file">attachment 16911</a> <a href="attachment.cgi?id=16911&action=edit" title="reproducing source as file">[details]</a></span>
reproducing source as file

-Wexceptions can detect duplicate `catch`es (e.g. catching int twice), but
fails to do so when using aliasing and aliased types mixed:

$ cat tmp.cpp
    typedef int int_;
    int main (int, char**) {
      try {
        throw 1;
      }
      catch (FIRST) {
        return __LINE__;
      }
      catch (SECOND) {
        return __LINE__;
      }
      return __LINE__;
    }

$ for first in int int_; do \
    for second in int int_; do \
      echo $first $second \
        $(clang++ -Weverything tmp.cpp -DFIRST=$first -DSECOND=$second 2>&1 |
wc -l) \
        $(./a.out; echo $?); \
  done; done

    int int 13 7
    int int_ 0 7
    int_ int 0 7
    int_ int_ 13 7

Only the case with the same name is detected (first and last). Note that all
combinations correctly call the first `catch` (line 7).</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>