<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 --- - fobjc-exceptions does not imply fexceptions"
   href="https://llvm.org/bugs/show_bug.cgi?id=30278">30278</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fobjc-exceptions does not imply fexceptions
          </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>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>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>vries@gcc.gnu.org
          </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>Consider basic.m:
...
#import <objc/Object.h>
#import <stdio.h>

int
main (void)
{
  @try {

    printf ("try\n");

    @throw nil;

  } @catch (...) {

    printf ("caught\n");

  }

  printf ("done\n");
  return 0;
}
...

with gcc, we have:
...
$ gcc basic.m -fobjc-exceptions -lobjc && (./a.out ; echo $? )
try
caught
done
0
...

However, with clang, we have:
...
$ clang basic.m -fobjc-exceptions -lobjc && (./a.out ; echo $? )
try
Aborted (core dumped)
134
...

Only when I add -fexceptions to the clang command line, do I get the same:
...
try
caught
done
0
...

With gcc, -fobjc-exceptions implies -fexceptions (gcc/c-family/c-opts.c):
...
  if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
    flag_exceptions = 1;
...</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>