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

            Bug ID: 47582
           Summary: Crash on compiling invalid requires expression
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Created attachment 23984
  --> https://bugs.llvm.org/attachment.cgi?id=23984&action=edit
Files requested by the compiler in the crash message.

While writing an experimental implementation of std::is_polymorphic using a
requires expression, I made a small mistake in the program. I was expecting a
compile error, but Clang crashed instead (with an assertion failure):

template<class T>
inline constexpr bool is_polymorphic = requires {
  typename dynamic_cast<const volatile void*>(declval<T*>());
};

The expected output is a compile error (I strongly believe), the code is an
invalid usage of the requires { typename ... } clause.

I attached a bundle with all the files required by the crash. Since it was
fully reproducible, I minimized the example as much as I could.
"clang-crash.cpp" is the original source code, "cli-output.txt" is the console
output for running the command, and the other attachments are files requested
in the output of the compiler.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to