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: unassignedclangb...@nondot.org
          Reporter: tomasz.g.markiew...@gmail.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@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@asus:/tmp/bug$ cat main-warning.cc && clang++
-Wdocumentation-unknown-command main-warning.cc -c
/**
 * @file
 * Copyright (C) 2019 Bugs H. Unter (em...@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 (em...@domain.com)
                                          ^~~~~~~
2 warnings generated.





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

tgm@asus:/tmp/bug$ rm *.o; cat main-ok.cc && clang++
-Wdocumentation-unknown-command main-ok.cc
/**
 * @file
 * Copyright (C) 2019 Bugs H. Unter (em...@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@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to