summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-missing-variable-declarations.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn about missing declarations for partial template specializationsAaron Puchert2020-02-051-0/+2
| | | | | | | | | | Summary: Just like templates, they are excepted from the ODR rule. Reviewed By: aaron.ballman, rsmith Differential Revision: https://reviews.llvm.org/D68923 (cherry picked from commit 27684ae66d5545f211c0ac4393d0ba2bf3b5b47c)
* Suggestions to fix -Wmissing-{prototypes,variable-declarations}Aaron Puchert2019-06-181-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: I've found that most often the proper way to fix this warning is to add `static`, because if the code otherwise compiles and links, the function or variable is apparently not needed outside of the TU. We can't provide a fix-it hint for variable declarations, because multiple VarDecls can share the same type, and if we put static in front of that, we affect all declared variables, some of which might have previous declarations. We also provide no fix-it hint for the rare case of an `extern` function definition, because that would require removing `extern` and I have no idea how to get the source location of the storage class specifier from a FunctionDecl. I believe this information is only available earlier in the AST construction from DeclSpec::getStorageClassSpecLoc(), but we don't have that here. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D59402 llvm-svn: 363749
* PR35862: Suppress -Wmissing-variable-declarations warning on inline variables,Richard Smith2018-01-081-1/+22
| | | | | | variable templates, and instantiations thereof. llvm-svn: 322030
* Extend the tests for -Wmissing-variable-declarations.Ed Schouten2016-12-231-0/+5
| | | | | | | We shouldn't throw a warning when the static keyword is not present in an anonymous namespace, just like we do for -Wmissing-prototypes. llvm-svn: 290443
* Fix -Wmissing-variable-declarations regression.Eli Friedman2013-09-241-0/+6
| | | | | | | | This issue was introduced in r181677. PR17349. llvm-svn: 191339
* Add an additional test for namespaces and -Wmissing-variable-declarations. ↵Eli Friedman2012-10-241-0/+43
Move C++ test into SemaCXX. llvm-svn: 166616
OpenPOWER on IntegriCloud