[llvm-bugs] [Bug 27324] New: libclang/Windows: exceptions are not supported by default [regression from 3.6.2]

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 12 07:05:15 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27324

            Bug ID: 27324
           Summary: libclang/Windows: exceptions are not supported by
                    default [regression from 3.6.2]
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nikolai.kosjar at theqtcompany.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

libclang 3.6.2 on Windows can parse code with exceptions just fine, whereas lib
clang 3.8.0 produces "error: cannot use 'try' with exceptions disabled".

Providing -### as argument shows that libclang 3.8.0 does not have the
corresponding options -fcxx-exceptions and -fexceptions internally (libclang
3.6.2 did).

This forces libclang clients to explicitly pass in those options in order to
parse MSVC headers.



Details:

Given the following program making use of libclang:

  #include <clang-c/Index.h>

  #include <cstdlib>
  #include <cstdio>

  int main(int argc, char *argv[])
  {
      if (argc != 2) {
          fprintf(stderr, "Usage: $0 <file>\n");
          return 0;
      }

      CXIndex index = clang_createIndex(0, /*displayDiagnostics*/ 1);
      clang_parseTranslationUnit(index, argv[1], 0, 0, NULL, 0, 0);

      return 0;
  }

and the sample "inputfile.cpp":

  int main()
  {
      try { } catch (...) {}
  }

shows that:

libclang 3.8.0:

 $ libclangclient.exe intputfile.cpp:
 inputfile.cpp:3:5: error: cannot use 'try' with exceptions disabled
 $

libclang 3.6.2:

 $ libclangclient.exe intputfile.cpp:
 $

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160412/8a08ff79/attachment.html>


More information about the llvm-bugs mailing list