[llvm-bugs] [Bug 47176] Crash parsing friend constexpr function with noexcept(true) specifier

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 24 21:26:51 PDT 2020


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

ExtBit Coding <code at extbit.io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #5 from ExtBit Coding <code at extbit.io> ---
Hi Richard,

I pulled 8c98c8803430804010da06a07cfb291dab59067c, but got parse bug again. My
guess is that you fixed the non-template version of friend-noexcept
specification. It looks like the template version is still not working,
considering this example:

  class Foo {
    template <typename X>
    friend void test(X, int = 0) noexcept(true) {}
  };

I got similar dumps like:

  PLEASE submit a bug report to  and include the crash backtrace, preprocessed 
  source, and associated run script.
  Stack dump:
  ....

I think you might want to add template-friend-noexcept test case for this:

diff --git a/clang/test/Parser/cxx0x-decl.cpp
b/clang/test/Parser/cxx0x-decl.cpp
index 4ddcb8ccfd..8be98d6ef2 100644
--- a/clang/test/Parser/cxx0x-decl.cpp
+++ b/clang/test/Parser/cxx0x-decl.cpp
@@ -199,6 +199,11 @@ namespace AliasDeclEndLocation {
   B something_else;
 }

+class PR47176 {
+  friend void f(PR47176, int = 0) noexcept(true) {}
+};
+static_assert(noexcept(f(PR47176())), "");
+
 struct Base { virtual void f() = 0; virtual void g() = 0; virtual void h() =
0; };
 struct MemberComponentOrder : Base {
   void f() override __asm__("foobar") __attribute__(( )) {}

Best Regards,
Duzy

-- 
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/20200925/c2ea98d0/attachment.html>


More information about the llvm-bugs mailing list