[llvm-bugs] [Bug 44243] New: clang++ -Wdocumentation-unknown-command incorrect warning generated, removed by adding hash (#)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 6 09:12:34 PST 2019


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

            Bug ID: 44243
           Summary: clang++ -Wdocumentation-unknown-command incorrect
                    warning generated, removed by adding hash (#)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tomasz.g.markiewicz at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

clang++ incorrectly marks '@' in e-mail address and @file as unknown command
tag names. However, adding '#' (could be as a part of an include directive or
just placed as a comment) results in no false-positive warning.




Incorrect warnings are generated
------------------------------------

tgm at asus:/tmp/bug$ cat main-warning.cc && clang++
-Wdocumentation-unknown-command main-warning.cc -c
/**
 * @file
 * Copyright (C) 2019 Bugs H. Unter (email at domain.com)
 *
 * Created on Apr 9, 2019
 *
 */


int main() {

    return 0;
}
main-warning.cc:2:4: warning: unknown command tag name
[-Wdocumentation-unknown-command]
 * @file
   ^~~~~
main-warning.cc:3:43: warning: unknown command tag name
[-Wdocumentation-unknown-command]
 * Copyright (C) 2019 Bugs H. Unter (email at domain.com)
                                          ^~~~~~~
2 warnings generated.





No warning is generated
-----------------------------------

tgm at asus:/tmp/bug$ rm *.o; cat main-ok.cc && clang++
-Wdocumentation-unknown-command main-ok.cc
/**
 * @file
 * Copyright (C) 2019 Bugs H. Unter (email at domain.com)
 *
 * Created on Apr 9, 2019
 *
 */

//# -- if there is at least one '#' between the comment and main, then no
warning is reported

int main() {

    return 0;
}




Clang version
----------------------------------
tgm at asus:/tmp/bug$ clang++ --version
clang version 10.0.0 (https://github.com/llvm/llvm-project.git
4650b2f36949407ef25686440e3d65ac47709deb)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191206/44690021/attachment.html>


More information about the llvm-bugs mailing list