[llvm-bugs] [Bug 35011] New: Unable to parse main() when importing module interface

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 20 09:11:02 PDT 2017


            Bug ID: 35011
           Summary: Unable to parse main() when importing module interface
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mferoldif at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Created attachment 19323
  --> https://bugs.llvm.org/attachment.cgi?id=19323&action=edit
Clang's reproducible crash files

Clang crashes when trying to compile a simple translation unit containing an
`import` statement.

How to reproduce:

    $ cat math.mxx
    #include <utility>

    export module math;

    export namespace math
      template <typename... Ts>
        decltype(auto) sum(Ts && ...values)
          return (std::forward<Ts>(values) + ... + 0);

    $ cat main.cpp
    import math;

    int main()
      return math::sum(1, 2, 3);

    $ clang++ -std=c++2a -fmodules-ts --precompile -x c++-module -o math.pcm
    $ clang++ -std=c++2a -fmodules-ts -o math.pcm.o -c math.pcm
    $ clang++ -std=c++2a -fmodules-ts -fmodule-file=math.pcm main.cpp

Crash log: https://p.iotek.org/z17

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/20171020/772c4b4d/attachment.html>

More information about the llvm-bugs mailing list