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

Reid Kleckner <r...@google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED
                 CC|                            |r...@google.com

--- Comment #5 from Reid Kleckner <r...@google.com> ---
I think we need to do more work here. Clang warns on this code, and rejects it
outright in C++17, when MSVC accepts:

__declspec(nothrow) void __fastcall bar();
static_assert(noexcept(bar()));
__declspec(nothrow) void __fastcall bar() noexcept;
void foo() { bar(); }

$ clang-cl -std:c++17 -c t.cpp
t.cpp(3,37):  warning: exception specification in declaration does not match
previous declaration [-Wmicrosoft-exception-spec]
__declspec(nothrow) void __fastcall bar() noexcept;
                                    ^
t.cpp(1,37):  note: previous declaration is here
__declspec(nothrow) void __fastcall bar();
                                    ^
t.cpp(3,37):  error: conflicting types for 'bar'
__declspec(nothrow) void __fastcall bar() noexcept;
                                    ^
t.cpp(1,37):  note: previous declaration is here
__declspec(nothrow) void __fastcall bar();
                                    ^
1 warning and 1 error generated.

If you remove the -std:c++17, the "conflicting types" error goes away.

It's confusing that 'noexcept(bar())' evaluates to 'true' when
__declspec(nothrow) is present, but then we complain about mismatched types and
EH specifiers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to