This revision was automatically updated to reflect the committed changes.
Closed by commit rL314462: [Sema] Correct nothrow inherited by noexcept
(authored by erichkeane).
Changed prior to commit:
https://reviews.llvm.org/D38209?vs=116840=117053#toc
Repository:
rL LLVM
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
This is somewhat complicated in that noexcept, throw(), and
__attribute__(())/__declspec no throw are all synonyms for one another except
for the type system effect differences
erichkeane updated this revision to Diff 116840.
erichkeane marked 2 inline comments as done.
erichkeane added a comment.
2 small changes @aaron.ballman requested.
https://reviews.llvm.org/D38209
Files:
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/nothrow-as-noexcept-ctor.cpp
Index:
erichkeane added a comment.
In https://reviews.llvm.org/D38209#880559, @aaron.ballman wrote:
> In https://reviews.llvm.org/D38209#880553, @STL_MSFT wrote:
>
> > > do you think `__declspec(nothrow)` calling the terminate handler in Clang
> > > is a bug?
> >
> > It's certainly a behavior
aaron.ballman added a reviewer: rsmith.
aaron.ballman added a comment.
In https://reviews.llvm.org/D38209#880553, @STL_MSFT wrote:
> > do you think `__declspec(nothrow)` calling the terminate handler in Clang
> > is a bug?
>
> It's certainly a behavior difference with potential performance
STL_MSFT added a comment.
> do you think `__declspec(nothrow)` calling the terminate handler in Clang is
> a bug?
It's certainly a behavior difference with potential performance impact,
although I don't think it can be viewed as a bug, strictly speaking. MSVC
treats `__declspec(nothrow)` as
aaron.ballman added a comment.
I'm not certain we have the semantics of `__declspec(nothrow)` exactly correct
-- a simple test shows that `__attribute__((nothrow))`, `__declspec(nothrow)`,
and `noexcept(true)` are subtly different.
When I run this with MSVC 2017, the terminate handler is not
STL_MSFT added a comment.
This sounds right to me and the test looks good. (I'll let an actual compiler
dev sign off)
https://reviews.llvm.org/D38209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
erichkeane created this revision.
As reported in https://bugs.llvm.org/show_bug.cgi?id=33235,
a noexcept function was unable to inherit from a nothrow defaulted
constructor. Attribute "nothrow" is supposed to be semantically
identical to noexcept, and in fact, a number of other places in the