forked from OSchip/llvm-project
377748fd7b
Summary: clang has `-Wextra-semi` (D43162), which is not dictated by the currently selected standard. While that is great, there is at least one more source of need-less semis - 'null statements'. Sometimes, they are needed: ``` for(int x = 0; continueToDoWork(x); x++) ; // Ugly code, but the semi is needed here. ``` But sometimes they are just there for no reason: ``` switch(X) { case 0: return -2345; case 5: return 0; default: return 42; }; // <- oops ;;;;;;;;;;; <- OOOOPS, still not diagnosed. Clearly this is junk. ``` Additionally: ``` if(; // <- empty init-statement true) ; switch (; // empty init-statement x) { ... } for (; // <- empty init-statement int y : S()) ; } As usual, things may or may not go sideways in the presence of macros. While evaluating this diag on my codebase of interest, it was unsurprisingly discovered that Google Test macros are *very* prone to this. And it seems many issues are deep within the GTest itself, not in the snippets passed from the codebase that uses GTest. So after some thought, i decided not do issue a diagnostic if the semi is within *any* macro, be it either from the normal header, or system header. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=39111 | PR39111 ]] Reviewers: rsmith, aaron.ballman, efriedma Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52695 llvm-svn: 347339 |
||
---|---|---|
.. | ||
CommandGuide | ||
analyzer | ||
tools | ||
AddressSanitizer.rst | ||
AttributeReference.rst | ||
AutomaticReferenceCounting.rst | ||
Block-ABI-Apple.rst | ||
Block-ABI-Apple.txt | ||
BlockLanguageSpec.rst | ||
CMakeLists.txt | ||
ClangCheck.rst | ||
ClangCommandLineReference.rst | ||
ClangFormat.rst | ||
ClangFormatStyleOptions.rst | ||
ClangPlugins.rst | ||
ClangTools.rst | ||
ControlFlowIntegrity.rst | ||
ControlFlowIntegrityDesign.rst | ||
CrossCompilation.rst | ||
DataFlowSanitizer.rst | ||
DataFlowSanitizerDesign.rst | ||
DiagnosticsReference.rst | ||
DriverArchitecture.png | ||
DriverInternals.rst | ||
ExternalClangExamples.rst | ||
FAQ.rst | ||
HardwareAssistedAddressSanitizerDesign.rst | ||
HowToSetupToolingForLLVM.rst | ||
InternalsManual.rst | ||
IntroductionToTheClangAST.rst | ||
ItaniumMangleAbiTags.rst | ||
JSONCompilationDatabase.rst | ||
LTOVisibility.rst | ||
LanguageExtensions.rst | ||
LeakSanitizer.rst | ||
LibASTMatchers.rst | ||
LibASTMatchersReference.html | ||
LibASTMatchersTutorial.rst | ||
LibFormat.rst | ||
LibTooling.rst | ||
MSVCCompatibility.rst | ||
Makefile.sphinx | ||
MemorySanitizer.rst | ||
Modules.rst | ||
ObjectiveCLiterals.rst | ||
OpenMPSupport.rst | ||
PCHInternals.rst | ||
PCHLayout.graffle | ||
PCHLayout.png | ||
PTHInternals.rst | ||
RAVFrontendAction.rst | ||
README.txt | ||
RefactoringEngine.rst | ||
ReleaseNotes.rst | ||
SafeStack.rst | ||
SanitizerCoverage.rst | ||
SanitizerSpecialCaseList.rst | ||
SanitizerStats.rst | ||
ShadowCallStack.rst | ||
SourceBasedCodeCoverage.rst | ||
ThinLTO.rst | ||
ThreadSafetyAnalysis.rst | ||
ThreadSanitizer.rst | ||
Toolchain.rst | ||
Tooling.rst | ||
UndefinedBehaviorSanitizer.rst | ||
UsersManual.rst | ||
conf.py | ||
doxygen-mainpage.dox | ||
doxygen.cfg.in | ||
index.rst | ||
make.bat |
README.txt
See llvm/docs/README.txt