7 Commits

Author SHA1 Message Date
Stephan Bergmann
07bcdbaed1 loplugin:dynexcspec: Deallocation functions are implicitly non-throwing
...so a dynamic exception specification should be replaced with noexcept(false).
Doesn't look like this omission made any difference when running the rewriter
across the LO code base earlier, though.

Change-Id: Ib0e2b412b65cae7c1a68e875bbddf93f3656cebb
2017-02-10 17:52:15 +01:00
Stephan Bergmann
53a9e834f0 ...and Clang 4 will have it, too
Change-Id: Ia927ed7d1e7815e59ccb67246da6981c65683168
2017-01-27 11:58:18 +01:00
Stephan Bergmann
f4fac7f341 getExceptionSpecSourceRange is new in Clang 5
Change-Id: Ifa9223fadeeb1fde54afc99874a1b3d855073dce
2017-01-27 11:50:36 +01:00
Stephan Bergmann
1a90a23d9f Enable loplugin:dynexcspec rewriting mode
Change-Id: I73404287c387a36e224683f75e967d51d911175b
2017-01-27 10:47:16 +01:00
Stephan Bergmann
b61214c91d Remove dynamic exception specifications from !LIBO_INTERNAL_ONLY
...only odk/examples/ remains to be clean up

Change-Id: I875a1e8d6750b6b007bd75126b8010273e1f32d5
2017-01-27 10:40:41 +01:00
Stephan Bergmann
09768d8ee4 Use proper check for FunctionProtoType
...as at least MSVC SAL_CALL-annotated functions have an AttributeType wrapped
around the FunctionProtoType.

Change-Id: Ic085e2e3649e6b2fc8ca380047133a8edbe20589
2017-01-24 17:30:51 +01:00
Stephan Bergmann
28ec4d1456 New loplugin:dynexcspec: Add @throws documentation
See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

* The check for missing @throws documentation is not too specific, it just
  checks whether a function with dynamic exception specification has /any/
  @throws clause, not necessarily exactly matching the exception types.  (Many
  of the details in the existing dynamic exception specifications are probably
  not very useful, anyway.)

* When adding @throws clauses, I bluntly copied the exception specifications
  except for dropping any mentions of std::exception (except in the rare cases
  where that was the only exception typed mentioned).

* In many places it might have looked more natural to use trailing Doxygen
  comments of the

    ///< @throws ...

  kind, but Clang's getCommentForDecl unfortunately doesn't detect trailing
  comments on function decls.

* Also, Clang's getCommentForDecl doesn't look into macros, so some trivial
  silly macros were expanded along the way to add comments where necessary.

Change-Id: I1831d72df2d9c801d4b8dd7d708d9cefea039589
2017-01-19 18:03:26 +01:00