[PATCH] D33841: [clang-tidy] redundant keyword check

Daniel Kolozsvari via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 29 09:35:05 PST 2019


koldaniel marked an inline comment as done.
koldaniel added inline comments.


================
Comment at: docs/clang-tidy/checks/readability-redundant-keyword.rst:8
+
+`extern` is redundant in function declarations
+
----------------
alexfh wrote:
> xazax.hun wrote:
> > alexfh wrote:
> > > Could you explain, why you think `extern` is redundant in function declarations?
> > Just to be clear here, do you think there is a case where extern is not redundant or you just want the documentation to be extended? 
> Sorry for being unclear. I would expect a more in-depth explanation of why the keyword is redundant with references to the appropriate sections of the standard or some other authoritative source.
https://en.cppreference.com/w/cpp/language/language_linkage

The default language linkage is C++, so without any additional parameters it is redundant (**extern "C++"** can also be redundant, but it depends on the context). In C context (**extern "C"**) the situation is the same, **extern** keyword is redundant for function declarations (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf - 6.2.2.5) 


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D33841/new/

https://reviews.llvm.org/D33841





More information about the cfe-commits mailing list