From: Dmitri Gribenko Date: Sun, 16 Dec 2012 17:38:09 +0000 (+0000) Subject: Clang ReleaseNotes: add information about documentation comments support X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f35f74017aa581986927bb3602d98a1ce969093;p=clang Clang ReleaseNotes: add information about documentation comments support git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170294 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html index 8a195f0b83..f1f70c77f7 100644 --- a/docs/ReleaseNotes.html +++ b/docs/ReleaseNotes.html @@ -174,6 +174,10 @@ int f(vector<map<int, double>>); -fsanitize=undefined and has grown the ability to check for several new types of undefined behavior. See the Users Manual for more information. + +
  • -Wdocumentation enables warnings about documentation comments. + See section "Documentation comment support" for an example.
  • + @@ -215,6 +219,35 @@ function call.

    pointer_with_type_tag and type_tag_for_datatype attributes in Clang language extensions documentation.

    +

    Documentation comment support

    +

    Clang now supports documentation comments written in a Doxygen-like syntax. +Clang parses the comments and can detect syntactic and semantic errors in +comments. These warnings are off by default. Pass -Wdocumentation +flag to enable warnings about documentation comments.

    + +

    For example, given:

    + +
    /// \param [in] Str the string.
    +/// \returns a modified string.
    +void do_something(const std::string &str);
    + +

    clang -Wdocumentation will emit two warnings:

    + +
    doc-test.cc:3:6: warning: '\returns' command used in a comment that is attached to a function returning void [-Wdocumentation]
    +/// \returns a modified string.
    +    ~^~~~~~~~~~~~~~~~~~~~~~~~~~
    +doc-test.cc:2:17: warning: parameter 'Str' not found in the function declaration [-Wdocumentation]
    +/// \param [in] Str the string.
    +                ^~~
    +doc-test.cc:2:17: note: did you mean 'str'?
    +/// \param [in] Str the string.
    +                ^~~
    +                str
    + +

    libclang includes a new API, clang_FullComment_getAsXML, to convert +comments to XML documents. This API can be used to build documentation +extraction tools.

    +

    New Compiler Flags