llvm-project/clang/lib
Hans Wennborg 9541975071 Revert r318556 "Loosen -Wempty-body warning"
It seems this somehow made -Wempty-body fire in some macro cases where
it didn't before, e.g.

  ../../third_party/ffmpeg/libavcodec/bitstream.c(169,5):  error: if statement has empty body [-Werror,-Wempty-body]
      ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
      ^
  ../../third_party/ffmpeg\libavutil/internal.h(276,80):  note: expanded from macro 'ff_dlog'
  #   define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
                                                                                 ^
  ../../third_party/ffmpeg/libavcodec/bitstream.c(169,5):  note: put the
  semicolon on a separate line to silence this warning

Reverting until this can be figured out.

> Do not show it when `if` or `else` come from macros.
> E.g.,
>
>     #define USED(A) if (A); else
>     #define SOME_IF(A) if (A)
>
>     void test() {
>       // No warnings are shown in those cases now.
>       USED(0);
>       SOME_IF(0);
>     }
>
> Patch by Ilya Biryukov!
>
> Differential Revision: https://reviews.llvm.org/D40185

llvm-svn: 318665
2017-11-20 17:38:16 +00:00
..
ARCMigrate Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:23:19 +00:00
AST [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-11-18 01:47:41 +00:00
ASTMatchers ASTMatchers.h: Fix ODR violations by avoiding internal linkage variables in headers 2017-11-15 16:52:12 +00:00
Analysis [analyzer] Model correct dispatch_once() 'done' value in BodyFarm 2017-11-06 22:12:19 +00:00
Basic [X86] Add icelake CPU support for -march. 2017-11-19 02:55:15 +00:00
CodeGen [CodeGen] Move Reciprocals option from TargetOptions to CodeGenOptions 2017-11-20 17:09:22 +00:00
CrossTU [CrossTU] Fix handling of Cross Translation Unit directory path 2017-10-27 12:53:37 +00:00
Driver [ARM] For assembler files recognize -Xassembler or -Wa, -mthumb 2017-11-20 13:53:55 +00:00
Edit [clang] Fix format specifiers fixits for nested macros 2017-06-20 20:46:58 +00:00
Format clang-format: remove trailing lines in lamdas and arrow functions. 2017-11-17 18:06:33 +00:00
Frontend [CodeGen] Move Reciprocals option from TargetOptions to CodeGenOptions 2017-11-20 17:09:22 +00:00
FrontendTool [CMake] Use #cmakedefine01 for CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) 2017-10-18 05:21:17 +00:00
Headers [CUDA] Remove implementations of nexttoward. 2017-11-17 01:15:43 +00:00
Index [index] tag declarations should use the decl role instead of ref 2017-11-09 20:50:59 +00:00
Lex [refactor][extract] insert semicolons into extracted/inserted code 2017-11-03 18:11:22 +00:00
Parse Revert r318556 "Loosen -Wempty-body warning" 2017-11-20 17:38:16 +00:00
Rewrite [Analyzer] Add support for displaying cross-file diagnostic paths in HTML output 2017-08-03 18:12:22 +00:00
Sema Revert r318556 "Loosen -Wempty-body warning" 2017-11-20 17:38:16 +00:00
Serialization [PCH+Modules] Improve diagnosticts to help out users pass an extra header search path 2017-11-17 03:24:11 +00:00
StaticAnalyzer Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings. 2017-11-16 03:18:09 +00:00
Tooling Fix skipping of flags in getClangStripDependencyFileAdjuster 2017-11-17 16:27:21 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00