[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-06-01 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. This change had another breaking effect as well, for the MinGW target. Code that implements a COM interface easily ends up overriding a `__declspec(nothrow)` function with a method that in most cases (at least in cases that follow the microsoft sample code) lacks the

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-31 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D62435#1524824 , @mstorsjo wrote: > This change broke compiling Qt on MinGW, see > https://bugs.llvm.org/show_bug.cgi?id=42089. Trivially reproducible by trying > to compile a snippet that looks like this: > > class Foo

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-31 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. This change broke compiling Qt on MinGW, see https://bugs.llvm.org/show_bug.cgi?id=42089. Trivially reproducible by trying to compile a snippet that looks like this: class Foo { public: __attribute__((nothrow)) void __attribute__((__stdcall__)) Bar();

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-30 Thread Erich Keane via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. erichkeane marked 2 inline comments as done. Closed by commit rL362119: Add Attribute NoThrow as an Exception Specifier Type (authored by erichkeane, committed by ). Herald added a project: LLVM. Herald added a subscriber:

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-30 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 6 inline comments as done. erichkeane added inline comments. Comment at: clang/include/clang/Sema/DeclSpec.h:1547 + bool hasAttr(ParsedAttr::Kind Kind) const { +return llvm::find_if(getAttrs(), [Kind](const ParsedAttr ) { aaron.ballman

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM aside from some minor nits. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2789 InGroup; +def warn_nothrow_attribute_ignored : Warning<"nothrow attribute conflicts with" + " exception

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-28 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Seems fine to me; please wait for @aaron.ballman's review to conclude as well. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62435/new/ https://reviews.llvm.org/D62435

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-28 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 201673. erichkeane marked 5 inline comments as done. erichkeane added a comment. Added warning + other comments from @aaron.ballman The exception state was further along than I expected, so I was able to make the warning better than I thought! CHANGES

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:6970 +if (Proto->hasExceptionSpec()) + return true; + erichkeane wrote: > aaron.ballman wrote: > > I think we should diagnose that the `nothrow` is ignored in this case to > >

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-27 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked an inline comment as done. erichkeane added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:6970 +if (Proto->hasExceptionSpec()) + return true; + aaron.ballman wrote: > I think we should diagnose that the `nothrow` is ignored

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang-c/Index.h:227 + /** + * The cursor has a declspec(nothrow) exception specification. + */ `__declspec(nothrow)` Comment at:

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 201404. erichkeane marked 2 inline comments as done. erichkeane added a comment. Reread @rsmith's comments and surrounding code and found what I believe is the correct answer to these comments :) CHANGES SINCE LAST ACTION

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 2 inline comments as done. erichkeane added inline comments. Comment at: clang/include/clang-c/Index.h:202-204 + * The cursor has a declspec(nothrow) exception specification. + */ + CXCursor_ExceptionSpecificationKind_NoThrow, rsmith

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith requested changes to this revision. rsmith added a comment. This revision now requires changes to proceed. Seems like a nice approach to the problem, but we need to not break the libclang C ABI :) Comment at: clang/include/clang-c/Index.h:202-204 + * The cursor has a

[PATCH] D62435: Add Attribute NoThrow as an Exception Specifier Type

2019-05-24 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. erichkeane added reviewers: rnk, lebedev.ri, aaron.ballman. Herald added subscribers: cfe-commits, arphaman. Herald added a project: clang. In response to https://bugs.llvm.org/show_bug.cgi?id=33235, it became clear that the current mechanism of hacking through