[clang-tools-extra] r374540 - [ClangTidy] Separate tests for infrastructure and checkers

Dmitri Gribenko via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 05:05:46 PDT 2019


Author: gribozavr
Date: Fri Oct 11 05:05:42 2019
New Revision: 374540

URL: http://llvm.org/viewvc/llvm-project?rev=374540&view=rev
Log:
[ClangTidy] Separate tests for infrastructure and checkers

Summary:
This change moves tests for checkers and infrastructure into separate
directories, making it easier to find infrastructure tests. Tests for
checkers are already easy to find because they are named after the
checker. Tests for infrastructure were difficult to find because they
were outnumbered by tests for checkers. Now they are in a separate
directory.

Reviewers: jfb, jdoerfert, lebedev.ri

Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68807

Added:
    clang-tools-extra/trunk/test/clang-tidy/checkers/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/a.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/b.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang-c/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang-c/c.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang/b.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-a.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-b.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-c.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/gtest/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/gtest/foo.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/i.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/j.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm-c/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm-c/d.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm/a.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/s.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/system-header-simulation.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/external-file.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/flags/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/flags/internal-file.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/strings/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/strings/internal-file.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/time/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/time/time.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/a.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdarg.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdlib.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/j.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/r.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/s.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/t.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/transitive.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/transitive2.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/google-namespaces.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest-typed-test.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest-typed-test.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/assert.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/complex.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/ctype.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/errno.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/fenv.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/float.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/inttypes.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/iso646.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/limits.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/locale.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/math.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/setjmp.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/signal.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdalign.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdarg.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdbool.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stddef.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdint.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdio.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdlib.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/string.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/tgmath.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/time.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/uchar.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/wchar.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/wctype.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-loop-convert/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-loop-convert/structures.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header-with-fix.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-replace-auto-ptr/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-replace-auto-ptr/memory.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/initializer_list.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/shared_ptr.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/unique_ptr.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-use-auto/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-use-auto/containers.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/mpi-type-mismatch/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/mpi-type-mismatch/mpimock.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header-fixed.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/system-header.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/user-header.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/unused-using-decls.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-addition.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-comparison.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-conversion-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-division.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-float.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-scale.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-subtraction.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-unnecessary-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-faster-strsplit-delimiter.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-namespace.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-redundant-strcat-calls.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-str-cat-append.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-string-find-startswith.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-comparison.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-subtraction.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-upgrade-duration-conversions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept4.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-creat.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-dup.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create1.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-fopen.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init1.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-memfd-create.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-open.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe2.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-socket.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/android-comparison-in-temp-failure-retry.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/boost-use-to-string.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-gmock.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-ignore-single-argument.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-literals.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-assert-side-effect.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-bool-pointer-implicit-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone-macro-crash.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-copy-constructor-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dangling-handle.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dynamic-static-initializers.hpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape-openmp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-fold-init-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forward-declaration-namespace.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-inaccurate-erase.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-incorrect-roundings.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-infinite-loop.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-integer-division.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-lambda-function-name.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses-cmdline.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-repeated-side-effects.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-explicit-only.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-implicit-enabled.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-move-forwarding-reference.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-multiple-statement-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-parent-virtual-call.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-posix-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-sizeof-container.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-sizeof-expression.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-string-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-string-integer-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-string-literal-with-embedded-nul.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-enum-usage-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-enum-usage.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-memset-usage.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-missing-comma.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-semicolon-fail.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-semicolon.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-string-compare.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-suspicious-string-compare.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-swapped-arguments.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-terminating-continue.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-throw-keyword-missing.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-too-small-loop-variable.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-undefined-memory-manipulation.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-undelegated-constructor-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-undelegated-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-unused-raii.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-unused-return-value-custom.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-unused-return-value.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-use-after-move.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-virtual-near-miss.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-dcl21-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-dcl58-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-env33-c.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-err34-c.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-err34-c.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-flp30-c.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-limited-randomness.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-limited-randomness.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-msc32-c.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-msc51-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-oop11-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-oop54-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-setlongjmp.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-static-object-exception.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-throw-exception-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-uppercase-literal-suffix-integer.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cert-variadic-function-def.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-avoid-goto.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-interfaces-global-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-macro-usage-caps-only.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-macro-usage-command-line-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-macro-usage-custom.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-macro-usage.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-long-is-32bits.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-narrowingfloatingpoint-option.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-pedanticmode-option.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-unsigned-char.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-no-malloc-custom.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-no-malloc-no-functions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-no-malloc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-owning-memory-containers.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-owning-memory-legacy-functions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-owning-memory.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-bounds-array-to-pointer-decay.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-bounds-constant-array-index.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-const-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-cstyle-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init-cxx2a.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init-no-crash.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init-use-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-reinterpret-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-static-cast-downcast.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-union-access.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-pro-type-vararg.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-slicing.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-special-member-functions-cxx-03.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-special-member-functions-relaxed.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/cppcoreguidelines-special-member-functions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/darwin-avoid-spinlock.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/darwin-dispatch-once-nonstatic.mm
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-default-arguments-calls.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-default-arguments-declarations.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-multiple-inheritance.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-overloaded-operator.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-restrict-system-includes-all.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-restrict-system-includes-glob.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-restrict-system-includes-headers.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-restrict-system-includes.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-statically-constructed-objects.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-trailing-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/fuchsia-virtual-inheritance.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-build-explicit-make-pair.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-default-arguments.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-explicit-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-module.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-namespaces.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-objc-avoid-nsobject-new.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-objc-avoid-throwing-exception.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-objc-function-naming.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-objc-function-naming.mm
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-objc-global-variable-declaration.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-objc-global-variable-declaration.mm
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-overloaded-unary-and.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-readability-casting.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-readability-casting.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-readability-casting.mm
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-readability-namespace-comments.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-readability-nested-namespace-comments.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-readability-todo.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-runtime-int-std.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-runtime-int.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-runtime-int.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-runtime-int.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-runtime-references.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/google-upgrade-googletest-case.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-exception-baseclass.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-multiway-paths-covered-else.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-multiway-paths-covered.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-no-assembler-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-no-assembler.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-signed-bitwise-bug34747.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-signed-bitwise-standard-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-signed-bitwise-standard-types.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/hicpp-signed-bitwise.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/linuxkernel-must-check-errs.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/llvm-include-order.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/llvm-prefer-isa-or-dyn-cast-in-conditionals.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/llvm-prefer-register-over-unsigned.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/llvm-prefer-register-over-unsigned2.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/llvm-prefer-register-over-unsigned3.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/llvm-twine-local.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-definitions-in-headers-1z.hpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-definitions-in-headers.hpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-misplaced-const-cxx17.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-misplaced-const.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-misplaced-const.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-new-delete-overloads-sized-dealloc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-new-delete-overloads.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-non-copyable-objects.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-non-copyable-objects.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-non-private-member-variables-in-classes.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-redundant-expression.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-static-assert.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-static-assert.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-throw-by-value-catch-by-reference.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unconventional-assign-operator-cxx17.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unconventional-assign-operator.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-uniqueptr-reset-release.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unused-alias-decls.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unused-parameters-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unused-parameters.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unused-parameters.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unused-using-decls-errors.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/misc-unused-using-decls.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-avoid-bind.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-avoid-c-arrays-ignores-main.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-avoid-c-arrays-ignores-three-arg-main.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-avoid-c-arrays.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-concat-nested-namespaces.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-deprecated-headers-cxx03.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-deprecated-headers-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-deprecated-ios-base-aliases.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-assert-failure.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-basic.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-camelback.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-const.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-extra.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-lowercase.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-negative.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert-uppercase.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-loop-convert.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-shared-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-shared.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-unique-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-unique-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-unique-inaccessible-ctors.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-unique-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-make-unique.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-pass-by-value-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-pass-by-value-macro-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-pass-by-value-multi-fixes.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-pass-by-value.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-raw-string-literal-delimiter.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-raw-string-literal-replace-shorter.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-raw-string-literal.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-redundant-void-arg-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-redundant-void-arg.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-redundant-void-arg.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-replace-auto-ptr.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-replace-random-shuffle.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-return-braced-init-list.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-shrink-to-fit.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-unary-static-assert.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-auto-cast-remove-stars.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-auto-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-auto-iterator.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-auto-min-type-name-length.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-auto-new-remove-stars.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-auto-new.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-bool-literals-ignore-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-bool-literals.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-default-member-init-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-default-member-init-bitfield.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-default-member-init-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-default-member-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-emplace-ignore-implicit-constructors.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-emplace.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-equals-default-copy.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-equals-default-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-equals-default-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-equals-default.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-equals-delete-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-equals-delete.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nodiscard-clang-unused.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nodiscard-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nodiscard-gcc-unused.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nodiscard-no-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nodiscard.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-noexcept-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-noexcept-opt.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-noexcept.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nullptr.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-nullptr.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-override-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-override-ms.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-override-no-destructors.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-override-with-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-override-with-no-macro-inscope.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-override.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-trailing-return-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-transparent-functors.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-uncaught-exceptions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-using-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/modernize-use-using.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/mpi-buffer-deref.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/mpi-type-mismatch.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/objc-avoid-nserror-init.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/objc-forbidden-subclassing-custom.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/objc-forbidden-subclassing.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/objc-missing-hash.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/objc-property-declaration.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/objc-super-self.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/openmp-exception-escape.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/openmp-use-default-none.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-faster-string-find.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-for-range-copy-allowed-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-for-range-copy-warn-on-all-auto-copies.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-for-range-copy.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-implicit-conversion-in-loop.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-inefficient-algorithm.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-inefficient-string-concatenation.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-inefficient-vector-operation.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-move-const-arg-trivially-copyable.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-move-const-arg.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-move-constructor-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-noexcept-move-constructor-fix.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-noexcept-move-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-type-promotion-in-math-fn.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-copy-initialization-allowed-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param-allowed-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param-arc.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param-arc.mm
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param-incomplete-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/performance-unnecessary-value-param.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/portability-simd-intrinsics-ppc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/portability-simd-intrinsics-x86.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-avoid-const-params-in-decls.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-avoid-underscore-in-googletest-name.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-braces-around-statements-assert-failure.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-braces-around-statements-few-lines.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-braces-around-statements-format.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-braces-around-statements-same-line.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-braces-around-statements-single-line.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-braces-around-statements.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-const-return-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-container-size-empty.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-convert-member-functions-to-static.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-delete-null-pointer.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-deleted-default.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-else-after-return-if-constexpr.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-else-after-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-function-size-variables-c++17.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-function-size.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-identifier-naming-bugfix.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-identifier-naming-objc.m
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-identifier-naming.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-implicit-bool-conversion-allow-in-conditions.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-implicit-bool-conversion-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-implicit-bool-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-inconsistent-declaration-parameter-name-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-inconsistent-declaration-parameter-name-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-inconsistent-declaration-parameter-name.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-isolate-declaration-cxx17.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-isolate-declaration-fixing.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-isolate-declaration-no-infinite-loop.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-isolate-declaration.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-isolate-declaration.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-magic-numbers.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-misleading-indentation.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-misplaced-array-index.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-named-parameter.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-non-const-parameter.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-control-flow.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-declaration-ignore-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-declaration.c
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-declaration.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-function-ptr-dereference.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-member-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-preprocessor-ifdef.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-preprocessor.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-preprocessor.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-smartptr-get-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-smartptr-get-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-smartptr-get.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-string-cstr-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-string-cstr.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-string-init-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-redundant-string-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-simplify-bool-expr-chained-conditional-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-simplify-bool-expr-chained-conditional-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-simplify-bool-expr-members.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-simplify-bool-expr.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-simplify-subscript-expr.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-static-accessed-through-instance-nesting-threshold.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-static-accessed-through-instance.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-static-definition-in-anonymous-namespace.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-string-compare.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uniqueptr-delete-release.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-float16.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-floating-point.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-hexadecimal-floating-point.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer-custom-list.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer-ms.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix-integer.cpp
    clang-tools-extra/trunk/test/clang-tidy/checkers/readability-uppercase-literal-suffix.h
    clang-tools-extra/trunk/test/clang-tidy/checkers/zircon-temporary-objects.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/Headers/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/Headers/a.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/Headers/b.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/Headers/s.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/Headers/stdio.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/compilation-database/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/compilation-database/template.json
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/config-files/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/config-files/.clang-tidy
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/config-files/1/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/config-files/1/.clang-tidy
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/empty-database/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/empty-database/compile_commands.json
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/expand-modular-headers-ppcallbacks/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/expand-modular-headers-ppcallbacks/a.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/expand-modular-headers-ppcallbacks/b.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/expand-modular-headers-ppcallbacks/c.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/expand-modular-headers-ppcallbacks/module.modulemap
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/explain-config/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/explain-config/.clang-tidy
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/file-filter/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/file-filter/header1.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/file-filter/header2.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/file-filter/system/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/file-filter/system/system-header.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/line-filter/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/line-filter/header1.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/line-filter/header2.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/line-filter/header3.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/bin/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/bin/clang
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/include/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/include/c++/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/include/c++/v1/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/mock-libcxx/include/c++/v1/mock_vector
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/nolint/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/nolint/trigger_warning.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/overlapping/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/overlapping/o.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/vfsoverlay/
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/vfsoverlay/actual_header.h
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/Inputs/vfsoverlay/vfsoverlay.yaml
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/alternative-fixes.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/basic.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/check_clang_tidy.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-__clang_analyzer__macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-enable-check-profile-one-tu.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-enable-check-profile-two-tu.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-mac-libcxx.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-run-with-database.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clang-tidy-store-check-profile-one-tu.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/clean-up-code.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/config-files.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/custom-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/deduplication.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/diagnostic.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/duplicate-reports.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/empty-database.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/enable-alpha-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/explain-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/export-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/export-relpath.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/extra-args.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/file-filter-symlinks.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/file-filter.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/fix-errors.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/fix.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/line-filter.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/list-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/nolint-plugin.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/nolint.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/nolintnextline-plugin.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/nolintnextline.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/nonstandard-file-extension.test
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/objc-arc-and-properties.m
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/objc-no-arc-or-properties.m
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/overlapping.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/pr37091.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/read_file_config.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/run-clang-tidy.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/select-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/serialize-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/static-analyzer-config.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/static-analyzer.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/temporaries.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/validate-check-names.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/vfsoverlay.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/warnings-as-errors-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/warnings-as-errors-plural.cpp
    clang-tools-extra/trunk/test/clang-tidy/infrastructure/warnings-as-errors.cpp
Removed:
    clang-tools-extra/trunk/test/clang-tidy/Inputs/
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-addition.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-comparison.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-conversion-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-division.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-float.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-scale.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-subtraction.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-no-internal-dependencies.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-no-namespace.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-redundant-strcat-calls.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-str-cat-append.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-string-find-startswith.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-time-comparison.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-time-subtraction.cpp
    clang-tools-extra/trunk/test/clang-tidy/abseil-upgrade-duration-conversions.cpp
    clang-tools-extra/trunk/test/clang-tidy/alternative-fixes.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept4.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-creat.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-dup.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create1.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-fopen.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init1.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-memfd-create.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-open.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe2.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-cloexec-socket.cpp
    clang-tools-extra/trunk/test/clang-tidy/android-comparison-in-temp-failure-retry.c
    clang-tools-extra/trunk/test/clang-tidy/basic.cpp
    clang-tools-extra/trunk/test/clang-tidy/boost-use-to-string.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-gmock.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-assert-side-effect.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-bool-pointer-implicit-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone-macro-crash.c
    clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-copy-constructor-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-dangling-handle.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-dynamic-static-initializers.hpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape-openmp.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-fold-init-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-forward-declaration-namespace.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-inaccurate-erase.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-incorrect-roundings.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-infinite-loop.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-integer-division.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-lambda-function-name.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses-cmdline.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-repeated-side-effects.c
    clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.c
    clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-explicit-only.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-implicit-enabled.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-move-forwarding-reference.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-multiple-statement-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-parent-virtual-call.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-posix-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-container.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-expression.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-string-integer-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-string-literal-with-embedded-nul.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-memset-usage.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-missing-comma.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon-fail.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.c
    clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-swapped-arguments.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-terminating-continue.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-throw-keyword-missing.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-undefined-memory-manipulation.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-raii.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value-custom.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-use-after-move.cpp
    clang-tools-extra/trunk/test/clang-tidy/bugprone-virtual-near-miss.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-dcl21-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-dcl58-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-env33-c.c
    clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.c
    clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-flp30-c.c
    clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.c
    clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-msc32-c.c
    clang-tools-extra/trunk/test/clang-tidy/cert-msc51-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-oop11-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-oop54-cpp.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-setlongjmp.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-static-object-exception.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-throw-exception-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-uppercase-literal-suffix-integer.cpp
    clang-tools-extra/trunk/test/clang-tidy/cert-variadic-function-def.cpp
    clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-__clang_analyzer__macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-enable-check-profile-one-tu.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-enable-check-profile-two-tu.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-mac-libcxx.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-run-with-database.cpp
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-store-check-profile-one-tu.cpp
    clang-tools-extra/trunk/test/clang-tidy/clean-up-code.cpp
    clang-tools-extra/trunk/test/clang-tidy/config-files.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-avoid-goto.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-init-variables.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-interfaces-global-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-macro-usage-caps-only.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-macro-usage-command-line-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-macro-usage-custom.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-macro-usage.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-narrowing-conversions-long-is-32bits.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-narrowing-conversions-narrowingfloatingpoint-option.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-narrowing-conversions-pedanticmode-option.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-narrowing-conversions-unsigned-char.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-no-malloc-custom.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-no-malloc-no-functions.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-no-malloc.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-bounds-array-to-pointer-decay.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-const-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-cstyle-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx2a.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init-no-crash.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init-use-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-reinterpret-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-union-access.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-slicing.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-special-member-functions-relaxed.cpp
    clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-special-member-functions.cpp
    clang-tools-extra/trunk/test/clang-tidy/custom-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/darwin-avoid-spinlock.m
    clang-tools-extra/trunk/test/clang-tidy/darwin-dispatch-once-nonstatic.mm
    clang-tools-extra/trunk/test/clang-tidy/deduplication.cpp
    clang-tools-extra/trunk/test/clang-tidy/diagnostic.cpp
    clang-tools-extra/trunk/test/clang-tidy/duplicate-reports.cpp
    clang-tools-extra/trunk/test/clang-tidy/empty-database.cpp
    clang-tools-extra/trunk/test/clang-tidy/enable-alpha-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/expand-modular-headers-ppcallbacks.cpp
    clang-tools-extra/trunk/test/clang-tidy/explain-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/export-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/export-relpath.cpp
    clang-tools-extra/trunk/test/clang-tidy/extra-args.cpp
    clang-tools-extra/trunk/test/clang-tidy/file-filter-symlinks.cpp
    clang-tools-extra/trunk/test/clang-tidy/file-filter.cpp
    clang-tools-extra/trunk/test/clang-tidy/fix-errors.cpp
    clang-tools-extra/trunk/test/clang-tidy/fix.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-default-arguments-calls.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-default-arguments-declarations.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-multiple-inheritance.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-overloaded-operator.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-restrict-system-includes-all.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-restrict-system-includes.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-statically-constructed-objects.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-trailing-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/fuchsia-virtual-inheritance.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-build-explicit-make-pair.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-default-arguments.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-explicit-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-module.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-namespaces.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-objc-avoid-nsobject-new.m
    clang-tools-extra/trunk/test/clang-tidy/google-objc-avoid-throwing-exception.m
    clang-tools-extra/trunk/test/clang-tidy/google-objc-function-naming.m
    clang-tools-extra/trunk/test/clang-tidy/google-objc-function-naming.mm
    clang-tools-extra/trunk/test/clang-tidy/google-objc-global-variable-declaration.m
    clang-tools-extra/trunk/test/clang-tidy/google-objc-global-variable-declaration.mm
    clang-tools-extra/trunk/test/clang-tidy/google-overloaded-unary-and.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.c
    clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.mm
    clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-nested-namespace-comments.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-todo.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-runtime-int-std.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.c
    clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.m
    clang-tools-extra/trunk/test/clang-tidy/google-runtime-references.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-upgrade-googletest-case.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-exception-baseclass.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-multiway-paths-covered-else.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-multiway-paths-covered.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-no-assembler-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-no-assembler.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-standard-types.h
    clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise.cpp
    clang-tools-extra/trunk/test/clang-tidy/line-filter.cpp
    clang-tools-extra/trunk/test/clang-tidy/linuxkernel-must-check-errs.c
    clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-prefer-isa-or-dyn-cast-in-conditionals.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-prefer-register-over-unsigned.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-prefer-register-over-unsigned2.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-prefer-register-over-unsigned3.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-twine-local.cpp
    clang-tools-extra/trunk/test/clang-tidy/macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-definitions-in-headers-1z.hpp
    clang-tools-extra/trunk/test/clang-tidy/misc-definitions-in-headers.hpp
    clang-tools-extra/trunk/test/clang-tidy/misc-misplaced-const-cxx17.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-misplaced-const.c
    clang-tools-extra/trunk/test/clang-tidy/misc-misplaced-const.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-new-delete-overloads-sized-dealloc.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-new-delete-overloads.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-non-copyable-objects.c
    clang-tools-extra/trunk/test/clang-tidy/misc-non-copyable-objects.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-non-private-member-variables-in-classes.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-redundant-expression.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-static-assert.c
    clang-tools-extra/trunk/test/clang-tidy/misc-static-assert.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unconventional-assign-operator.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-uniqueptr-reset-release.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-alias-decls.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-parameters-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-parameters.c
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-parameters.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-using-decls-errors.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-using-decls.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-avoid-bind.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-avoid-c-arrays-ignores-main.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-avoid-c-arrays-ignores-three-arg-main.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-avoid-c-arrays.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-concat-nested-namespaces.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-ios-base-aliases.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-assert-failure.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-camelback.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-const.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-extra.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-lowercase.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-negative.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-uppercase.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert.c
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-shared-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-shared.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique-inaccessible-ctors.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-make-unique.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value-macro-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value-multi-fixes.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal-replace-shorter.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.c
    clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-replace-auto-ptr.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-replace-random-shuffle.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-return-braced-init-list.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-shrink-to-fit.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-unary-static-assert.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-auto-cast.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-auto-iterator.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-auto-min-type-name-length.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-auto-new-remove-stars.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-auto-new.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals-ignore-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-default-member-init-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-default-member-init-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-default-member-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-emplace-ignore-implicit-constructors.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-emplace.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-equals-default-copy.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-equals-default-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-equals-default-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-equals-default.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-equals-delete-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-equals-delete.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nodiscard-clang-unused.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nodiscard-gcc-unused.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nodiscard-no-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nodiscard.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-noexcept-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-noexcept-opt.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-noexcept.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr.c
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-override-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-override-ms.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-override-no-destructors.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-override-with-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-override-with-no-macro-inscope.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-override.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-trailing-return-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-transparent-functors.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-uncaught-exceptions.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-using-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-using.cpp
    clang-tools-extra/trunk/test/clang-tidy/mpi-buffer-deref.cpp
    clang-tools-extra/trunk/test/clang-tidy/mpi-type-mismatch.cpp
    clang-tools-extra/trunk/test/clang-tidy/nolint-plugin.cpp
    clang-tools-extra/trunk/test/clang-tidy/nolint.cpp
    clang-tools-extra/trunk/test/clang-tidy/nolintnextline-plugin.cpp
    clang-tools-extra/trunk/test/clang-tidy/nolintnextline.cpp
    clang-tools-extra/trunk/test/clang-tidy/nonstandard-file-extension.test
    clang-tools-extra/trunk/test/clang-tidy/objc-arc-and-properties.m
    clang-tools-extra/trunk/test/clang-tidy/objc-avoid-nserror-init.m
    clang-tools-extra/trunk/test/clang-tidy/objc-forbidden-subclassing-custom.m
    clang-tools-extra/trunk/test/clang-tidy/objc-forbidden-subclassing.m
    clang-tools-extra/trunk/test/clang-tidy/objc-missing-hash.m
    clang-tools-extra/trunk/test/clang-tidy/objc-no-arc-or-properties.m
    clang-tools-extra/trunk/test/clang-tidy/objc-property-declaration.m
    clang-tools-extra/trunk/test/clang-tidy/objc-super-self.m
    clang-tools-extra/trunk/test/clang-tidy/openmp-exception-escape.cpp
    clang-tools-extra/trunk/test/clang-tidy/openmp-use-default-none.cpp
    clang-tools-extra/trunk/test/clang-tidy/overlapping.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-faster-string-find.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-for-range-copy-allowed-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-for-range-copy-warn-on-all-auto-copies.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-for-range-copy.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-implicit-conversion-in-loop.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-algorithm.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-string-concatenation.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-move-const-arg-trivially-copyable.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-move-const-arg.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-move-constructor-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-noexcept-move-constructor-fix.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-noexcept-move-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-type-promotion-in-math-fn.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-copy-initialization-allowed-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-copy-initialization.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param-allowed-types.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param-arc.m
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param-arc.mm
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param-header.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param.cpp
    clang-tools-extra/trunk/test/clang-tidy/portability-simd-intrinsics-ppc.cpp
    clang-tools-extra/trunk/test/clang-tidy/portability-simd-intrinsics-x86.cpp
    clang-tools-extra/trunk/test/clang-tidy/pr37091.cpp
    clang-tools-extra/trunk/test/clang-tidy/read_file_config.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-avoid-const-params-in-decls.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-avoid-underscore-in-googletest-name.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-assert-failure.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-few-lines.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-format.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-same-line.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-single-line.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-const-return-type.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-container-size-empty.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-convert-member-functions-to-static.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-delete-null-pointer.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-deleted-default.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-else-after-return-if-constexpr.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-else-after-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-function-size-variables-c++17.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-function-size.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming-bugfix.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming-objc.m
    clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-conversion-allow-in-conditions.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-conversion-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name-strict.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-isolate-declaration-cxx17.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-isolate-declaration-fixing.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-isolate-declaration-no-infinite-loop.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-isolate-declaration.c
    clang-tools-extra/trunk/test/clang-tidy/readability-isolate-declaration.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-magic-numbers.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-misleading-indentation.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-misplaced-array-index.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-named-parameter.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-non-const-parameter.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-control-flow.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration-ignore-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.c
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-function-ptr-dereference.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-member-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-preprocessor-ifdef.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-preprocessor.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-preprocessor.h
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get-macros.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-string-cstr-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-string-cstr.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-string-init-msvc.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-string-init.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr-chained-conditional-assignment.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr-chained-conditional-return.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr-members.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-simplify-subscript-expr.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-static-accessed-through-instance-nesting-threshold.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-static-accessed-through-instance.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-static-definition-in-anonymous-namespace.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-string-compare.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uniqueptr-delete-release.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-float16.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-floating-point.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-hexadecimal-floating-point.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-integer-custom-list.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-integer-macro.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-integer-ms.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix-integer.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-uppercase-literal-suffix.h
    clang-tools-extra/trunk/test/clang-tidy/run-clang-tidy.cpp
    clang-tools-extra/trunk/test/clang-tidy/select-checks.cpp
    clang-tools-extra/trunk/test/clang-tidy/serialize-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/static-analyzer-config.cpp
    clang-tools-extra/trunk/test/clang-tidy/static-analyzer.cpp
    clang-tools-extra/trunk/test/clang-tidy/temporaries.cpp
    clang-tools-extra/trunk/test/clang-tidy/validate-check-names.cpp
    clang-tools-extra/trunk/test/clang-tidy/vfsoverlay.cpp
    clang-tools-extra/trunk/test/clang-tidy/warnings-as-errors-diagnostics.cpp
    clang-tools-extra/trunk/test/clang-tidy/warnings-as-errors-plural.cpp
    clang-tools-extra/trunk/test/clang-tidy/warnings-as-errors.cpp
    clang-tools-extra/trunk/test/clang-tidy/zircon-temporary-objects.cpp

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-addition.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-addition.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-addition.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-addition.cpp (removed)
@@ -1,98 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-addition %t -- -- -I%S/Inputs
-
-#include "absl/time/time.h"
-
-void f() {
-  absl::Time t;
-  int i;
-
-  i = absl::ToUnixHours(t) + 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixHours(t + absl::Hours(5))
-  i = absl::ToUnixMinutes(t) + 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMinutes(t + absl::Minutes(5))
-  i = absl::ToUnixSeconds(t) + 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(5))
-  i = absl::ToUnixMillis(t) + 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMillis(t + absl::Milliseconds(5))
-  i = absl::ToUnixMicros(t) + 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMicros(t + absl::Microseconds(5))
-  i = absl::ToUnixNanos(t) + 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixNanos(t + absl::Nanoseconds(5))
-
-  i = 3 + absl::ToUnixHours(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixHours(absl::Hours(3) + t)
-  i = 3 + absl::ToUnixMinutes(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMinutes(absl::Minutes(3) + t)
-  i = 3 + absl::ToUnixSeconds(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixSeconds(absl::Seconds(3) + t)
-  i = 3 + absl::ToUnixMillis(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMillis(absl::Milliseconds(3) + t)
-  i = 3 + absl::ToUnixMicros(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMicros(absl::Microseconds(3) + t)
-  i = 3 + absl::ToUnixNanos(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixNanos(absl::Nanoseconds(3) + t)
-
-  // Undoing inverse conversions
-  i = absl::ToUnixMicros(t) + absl::ToInt64Microseconds(absl::Seconds(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixMicros(t + absl::Seconds(1))
-
-  // Parens
-  i = 3 + (absl::ToUnixHours(t));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixHours(absl::Hours(3) + t)
-
-  // Float folding
-  i = absl::ToUnixSeconds(t) + 5.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(5))
-
-  // We can rewrite the argument of the duration conversion
-#define THIRTY absl::FromUnixSeconds(30)
-  i = absl::ToUnixSeconds(THIRTY) + 1;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixSeconds(THIRTY + absl::Seconds(1))
-#undef THIRTY
-
-  // Some other contexts
-  if (absl::ToUnixSeconds(t) + 1.0 > 10) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(1))
-
-  // These should not match
-  i = 5 + 6;
-  i = absl::ToUnixSeconds(t) - 1.0;
-  i = absl::ToUnixSeconds(t) * 1.0;
-  i = absl::ToUnixSeconds(t) / 1.0;
-  i += absl::ToInt64Microseconds(absl::Seconds(1));
-
-#define PLUS_FIVE(z) absl::ToUnixSeconds(z) + 5
-  i = PLUS_FIVE(t);
-#undef PLUS_FIVE
-}
-
-// Within a templated function
-template<typename T>
-void foo(absl::Time t) {
-  int i = absl::ToUnixNanos(t) + T{};
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: perform addition in the duration domain [abseil-duration-addition]
-  // CHECK-FIXES: absl::ToUnixNanos(t + absl::Nanoseconds(T{}))
-}
-
-void g() {
-  absl::Time t;
-  foo<int>(t);
-  foo<double>(t);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-comparison.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-comparison.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-comparison.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-comparison.cpp (removed)
@@ -1,166 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-comparison %t -- -- -I%S/Inputs
-
-#include "absl/time/time.h"
-
-void f() {
-  double x;
-  absl::Duration d1, d2;
-  bool b;
-  absl::Time t1, t2;
-
-  // Check against the RHS
-  b = x > absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) > d1;
-  b = x >= absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) >= d1;
-  b = x == absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) == d1;
-  b = x <= absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) <= d1;
-  b = x < absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) < d1;
-  b = x == absl::ToDoubleSeconds(t1 - t2);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) == t1 - t2;
-  b = absl::ToDoubleSeconds(d1) > absl::ToDoubleSeconds(d2);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 > d2;
-
-  // Check against the LHS
-  b = absl::ToDoubleSeconds(d1) < x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 < absl::Seconds(x);
-  b = absl::ToDoubleSeconds(d1) <= x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 <= absl::Seconds(x);
-  b = absl::ToDoubleSeconds(d1) == x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 == absl::Seconds(x);
-  b = absl::ToDoubleSeconds(d1) >= x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 >= absl::Seconds(x);
-  b = absl::ToDoubleSeconds(d1) > x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 > absl::Seconds(x);
-
-  // Comparison against zero
-  b = absl::ToDoubleSeconds(d1) < 0.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 < absl::ZeroDuration();
-  b = absl::ToDoubleSeconds(d1) < 0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: d1 < absl::ZeroDuration();
-
-  // Scales other than Seconds
-  b = x > absl::ToDoubleMicroseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Microseconds(x) > d1;
-  b = x >= absl::ToDoubleMilliseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Milliseconds(x) >= d1;
-  b = x == absl::ToDoubleNanoseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Nanoseconds(x) == d1;
-  b = x <= absl::ToDoubleMinutes(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Minutes(x) <= d1;
-  b = x < absl::ToDoubleHours(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Hours(x) < d1;
-
-  // Integer comparisons
-  b = x > absl::ToInt64Microseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Microseconds(x) > d1;
-  b = x >= absl::ToInt64Milliseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Milliseconds(x) >= d1;
-  b = x == absl::ToInt64Nanoseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Nanoseconds(x) == d1;
-  b = x == absl::ToInt64Seconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(x) == d1;
-  b = x <= absl::ToInt64Minutes(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Minutes(x) <= d1;
-  b = x < absl::ToInt64Hours(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Hours(x) < d1;
-
-  // Other abseil-duration checks folded into this one
-  b = static_cast<double>(5) > absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(5) > d1;
-  b = double(5) > absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(5) > d1;
-  b = float(5) > absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(5) > d1;
-  b = ((double)5) > absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(5) > d1;
-  b = 5.0 > absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Seconds(5) > d1;
-
-  // A long expression
-  bool some_condition;
-  int very_very_very_very_long_variable_name;
-  absl::Duration SomeDuration;
-  if (some_condition && very_very_very_very_long_variable_name
-     < absl::ToDoubleSeconds(SomeDuration)) {
-  // CHECK-MESSAGES: [[@LINE-2]]:25: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: if (some_condition && absl::Seconds(very_very_very_very_long_variable_name) < SomeDuration) {
-    return;
-  }
-
-  // A complex expression
-  int y;
-  b = (y + 5) * 10 > absl::ToDoubleMilliseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: absl::Milliseconds((y + 5) * 10) > d1;
-
-  // We should still transform the expression inside this macro invocation
-#define VALUE_IF(v, e) v ? (e) : 0
-  int a = VALUE_IF(1, 5 > absl::ToDoubleSeconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: VALUE_IF(1, absl::Seconds(5) > d1);
-#undef VALUE_IF
-
-#define VALUE_IF_2(e) (e)
-#define VALUE_IF(v, e) v ? VALUE_IF_2(e) : VALUE_IF_2(0)
-  int a2 = VALUE_IF(1, 5 > absl::ToDoubleSeconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: perform comparison in the duration domain [abseil-duration-comparison]
-  // CHECK-FIXES: VALUE_IF(1, absl::Seconds(5) > d1);
-#undef VALUE_IF
-#undef VALUE_IF_2
-
-#define VALUE_IF_2(e) (e)
-#define VALUE_IF(v, e, type) (v ? VALUE_IF_2(absl::To##type##Seconds(e)) : 0)
-  int a3 = VALUE_IF(1, d1, Double);
-#undef VALUE_IF
-#undef VALUE_IF_2
-
-#define VALUE_IF_2(e) (e)
-#define VALUE_IF(v, e, type) (v ? (5 > VALUE_IF_2(absl::To##type##Seconds(e))) : 0)
-  int a4 = VALUE_IF(1, d1, Double);
-#undef VALUE_IF
-#undef VALUE_IF_2
-
-  // These should not match
-  b = 6 < 4;
-
-#define TODOUBLE(x) absl::ToDoubleSeconds(x)
-  b = 5.0 > TODOUBLE(d1);
-#undef TODOUBLE
-#define THIRTY 30.0
-  b = THIRTY > absl::ToDoubleSeconds(d1);
-#undef THIRTY
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-conversion-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-conversion-cast.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-conversion-cast.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-conversion-cast.cpp (removed)
@@ -1,95 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-conversion-cast %t -- -- -I%S/Inputs
-
-#include "absl/time/time.h"
-
-void f() {
-  absl::Duration d1;
-  double x;
-  int i;
-
-  i = static_cast<int>(absl::ToDoubleHours(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Hours(d1);
-  x = static_cast<float>(absl::ToInt64Hours(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleHours(d1);
-  i = static_cast<int>(absl::ToDoubleMinutes(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Minutes(d1);
-  x = static_cast<float>(absl::ToInt64Minutes(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleMinutes(d1);
-  i = static_cast<int>(absl::ToDoubleSeconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Seconds(d1);
-  x = static_cast<float>(absl::ToInt64Seconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleSeconds(d1);
-  i = static_cast<int>(absl::ToDoubleMilliseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Milliseconds(d1);
-  x = static_cast<float>(absl::ToInt64Milliseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleMilliseconds(d1);
-  i = static_cast<int>(absl::ToDoubleMicroseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Microseconds(d1);
-  x = static_cast<float>(absl::ToInt64Microseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
-  i = static_cast<int>(absl::ToDoubleNanoseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Nanoseconds(d1);
-  x = static_cast<float>(absl::ToInt64Nanoseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleNanoseconds(d1);
-
-  // Functional-style casts
-  i = int(absl::ToDoubleHours(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Hours(d1);
-  x = float(absl::ToInt64Microseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
-
-  // C-style casts
-  i = (int) absl::ToDoubleHours(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Hours(d1);
-  x = (float) absl::ToInt64Microseconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
-
-  // Type aliasing
-  typedef int FancyInt;
-  typedef float FancyFloat;
-
-  FancyInt j = static_cast<FancyInt>(absl::ToDoubleHours(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToInt64Hours(d1);
-  FancyFloat k = static_cast<FancyFloat>(absl::ToInt64Microseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:18: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
-
-  // Macro handling
-  // We want to transform things in macro arguments
-#define EXTERNAL(x) (x) + 5
-  i = EXTERNAL(static_cast<int>(absl::ToDoubleSeconds(d1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
-  // CHECK-FIXES: EXTERNAL(absl::ToInt64Seconds(d1));
-#undef EXTERNAL
-
-  // We don't want to transform this which get split across macro boundaries
-#define SPLIT(x) static_cast<int>((x)) + 5
-  i = SPLIT(absl::ToDoubleSeconds(d1));
-#undef SPLIT
-
-  // We also don't want to transform things inside of a macro definition
-#define INTERNAL(x) static_cast<int>(absl::ToDoubleSeconds((x))) + 5
-  i = INTERNAL(d1);
-#undef INTERNAL
-
-  // These shouldn't be converted
-  i = static_cast<int>(absl::ToInt64Seconds(d1));
-  i = static_cast<float>(absl::ToDoubleSeconds(d1));
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-division.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-division.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-division.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-division.cpp (removed)
@@ -1,75 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-division %t
-
-namespace absl {
-
-class Duration {};
-
-int operator/(Duration lhs, Duration rhs);
-
-double FDivDuration(Duration num, Duration den);
-
-}  // namespace absl
-
-void TakesDouble(double);
-
-#define MACRO_EQ(x, y) (x == y)
-#define MACRO_DIVEQ(x,y,z) (x/y == z)
-#define CHECK(x) (x)
-
-void Positives() {
-  absl::Duration d;
-
-  const double num_double = d/d;
-  // CHECK-MESSAGES: [[@LINE-1]]:30: warning: operator/ on absl::Duration objects performs integer division; did you mean to use FDivDuration()? [abseil-duration-division]
-  // CHECK-FIXES: const double num_double = absl::FDivDuration(d, d);
-  const float num_float = d/d;
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: operator/ on absl::Duration objects
-  // CHECK-FIXES: const float num_float = absl::FDivDuration(d, d);
-  const auto SomeVal = 1.0 + d/d;
-  // CHECK-MESSAGES: [[@LINE-1]]:31: warning: operator/ on absl::Duration objects
-  // CHECK-FIXES: const auto SomeVal = 1.0 + absl::FDivDuration(d, d);
-  if (MACRO_EQ(d/d, 0.0)) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:17: warning: operator/ on absl::Duration objects
-  // CHECK-FIXES: if (MACRO_EQ(absl::FDivDuration(d, d), 0.0)) {}
-  if (CHECK(MACRO_EQ(d/d, 0.0))) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: operator/ on absl::Duration objects
-  // CHECK-FIXES: if (CHECK(MACRO_EQ(absl::FDivDuration(d, d), 0.0))) {}
-
-  // This one generates a message, but no fix.
-  if (MACRO_DIVEQ(d, d, 0.0)) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: operator/ on absl::Duration objects
-  // CHECK-FIXES: if (MACRO_DIVEQ(d, d, 0.0)) {}
- 
-  TakesDouble(d/d);
-  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: operator/ on absl::Duration objects
-  // CHECK-FIXES: TakesDouble(absl::FDivDuration(d, d));
-}
-
-void TakesInt(int);
-template <class T>
-void TakesGeneric(T);
-
-void Negatives() {
-  absl::Duration d;
-  const int num_int = d/d;
-  const long num_long = d/d;
-  const short num_short = d/d;
-  const char num_char = d/d;
-  const auto num_auto = d/d;
-  const auto SomeVal = 1 + d/d;
-
-  TakesInt(d/d);
-  TakesGeneric(d/d);
-  // Explicit cast should disable the warning.
-  const double num_cast1 = static_cast<double>(d/d);
-  const double num_cast2 = (double)(d/d);
-}
-
-template <class T>
-double DoubleDivision(T t1, T t2) {return t1/t2;}
-
-//This also won't trigger a warning
-void TemplateDivision() {
-  absl::Duration d;
-  DoubleDivision(d, d);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-float.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-float.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-float.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-float.cpp (removed)
@@ -1,107 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-factory-float %t -- -- -I%S/Inputs
-
-#include "absl/time/time.h"
-
-void ConvertFloatTest() {
-  absl::Duration d;
-
-  d = absl::Seconds(60.0);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(60);
-  d = absl::Minutes(300.0);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Minutes(300);
-
-  d = absl::Milliseconds(1e2);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Milliseconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Milliseconds(100);
-  d = absl::Seconds(3.0f);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(3);
-  d = absl::Seconds(3.);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(3);
-  d = absl::Seconds(0x3.p0);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(3);
-  d = absl::Seconds(0x3.p1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(6);
-
-
-  // Ignored expressions
-  d = absl::Seconds(.001);
-  d = absl::Seconds(.100);
-  d = ::absl::Seconds(1);
-  d = ::absl::Minutes(1);
-  d = ::absl::Hours(1);
-  d = absl::Seconds(0x3.4p1);
-
-  // Negative literals (we don't yet handle this case)
-  d = absl::Seconds(-3.0);
-
-  // This is bigger than we can safely fit in a positive int32, so we ignore it.
-  d = absl::Seconds(1e12);
-
-  int x;
-  d = absl::Seconds(x);
-  float y;
-  d = absl::Minutes(y);
-
-#define SECONDS(x) absl::Seconds(x)
-  SECONDS(60);
-#undef SECONDS
-#define THIRTY 30.0
-  d = absl::Seconds(THIRTY);
-#undef THIRTY
-}
-
-template <int N>
-void InTemplate() {
-  absl::Duration d;
-
-  d = absl::Seconds(N);  // 1
-  // ^ No replacement here.
-
-  d = absl::Minutes(1.0);  // 2
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Minutes(1);  // 2
-}
-
-void Instantiate() {
-  InTemplate<60>();
-  InTemplate<1>();
-}
-
-void ConvertCastTest() {
-  absl::Duration d;
-
-  d = absl::Seconds(static_cast<double>(5));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(5);
-
-  d = absl::Minutes(static_cast<float>(5));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Minutes(5);
-
-  d = absl::Seconds((double) 5);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(5);
-
-  d = absl::Minutes((float) 5);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Minutes(5);
-
-  d = absl::Seconds(double(5));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Seconds(5);
-
-  d = absl::Minutes(float(5));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
-  // CHECK-FIXES: absl::Minutes(5);
-
-  // This should not be flagged
-  d = absl::Seconds(static_cast<int>(5.0));
-  d = absl::Seconds((int) 5.0);
-  d = absl::Seconds(int(5.0));
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-scale.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-scale.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-scale.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-factory-scale.cpp (removed)
@@ -1,118 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-factory-scale %t -- -- -I%S/Inputs
-
-#include "absl/time/time.h"
-
-namespace std { typedef long long int64_t; }
-using int64_t = std::int64_t;
-
-void ScaleTest() {
-  absl::Duration d;
-
-  // Zeroes
-  d = absl::Hours(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Minutes(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Seconds(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Milliseconds(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Microseconds(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Nanoseconds(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Seconds(0.0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Seconds(0x0.000001p-126f);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Seconds(int{0});
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Seconds(int64_t{0});
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-  d = absl::Seconds(float{0});
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::ZeroDuration();
-
-  // Fold seconds into minutes
-  d = absl::Seconds(30 * 60);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Minutes(30);
-  d = absl::Seconds(60 * 30);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Minutes(30);
-
-  // Try a few more exotic multiplications
-  d = absl::Seconds(60 * 30 * 60);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Minutes(60 * 30);
-  d = absl::Seconds(1e-3 * 30);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Milliseconds(30);
-  d = absl::Milliseconds(30 * 1000);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Seconds(30);
-  d = absl::Milliseconds(30 * 0.001);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Microseconds(30);
-
-  // Multiple steps
-  d = absl::Seconds(5 * 3600);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Hours(5);
-  d = absl::Microseconds(5 * 1e6);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Seconds(5);
-  d = absl::Seconds(5 * 1e-6);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Microseconds(5);
-  d = absl::Microseconds(5 * 1000000);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Seconds(5);
-
-  // Division
-  d = absl::Hours(30 / 60.);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Minutes(30);
-  d = absl::Seconds(30 / 1000.);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Milliseconds(30);
-  d = absl::Milliseconds(30 / 1e3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Microseconds(30);
-  d = absl::Seconds(30 / 1e6);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
-  // CHECK-FIXES: absl::Microseconds(30);
-
-  // None of these should trigger the check
-  d = absl::Seconds(60);
-  d = absl::Seconds(int{60});
-  d = absl::Seconds(float{60});
-  d = absl::Seconds(60 + 30);
-  d = absl::Seconds(60 - 30);
-  d = absl::Seconds(50 * 30);
-  d = absl::Hours(60 * 60);
-  d = absl::Nanoseconds(1e-3 * 30);
-  d = absl::Seconds(1000 / 30);
-  // We don't support division by integers, which could cause rounding
-  d = absl::Seconds(10 / 1000);
-  d = absl::Seconds(30 / 50);
-
-#define EXPRESSION 30 * 60
-  d = absl::Seconds(EXPRESSION);
-#undef EXPRESSION
-
-// This should not trigger
-#define HOURS(x) absl::Minutes(60 * x)
-  d = HOURS(40);
-#undef HOURS
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-subtraction.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-subtraction.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-subtraction.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-subtraction.cpp (removed)
@@ -1,64 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-duration-subtraction %t -- -- -I %S/Inputs
-
-#include "absl/time/time.h"
-
-void f() {
-  double x;
-  absl::Duration d, d1, d2;
-
-  x = absl::ToDoubleSeconds(d) - 1.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(1))
-  x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(d1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleSeconds(d - d1);
-  x = absl::ToDoubleSeconds(d) - 6.5 - 8.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(6.5)) - 8.0;
-  x = absl::ToDoubleHours(d) - 1.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleHours(d - absl::Hours(1))
-  x = absl::ToDoubleMinutes(d) - 1;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleMinutes(d - absl::Minutes(1))
-  x = absl::ToDoubleMilliseconds(d) - 9;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleMilliseconds(d - absl::Milliseconds(9))
-  x = absl::ToDoubleMicroseconds(d) - 9;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleMicroseconds(d - absl::Microseconds(9))
-  x = absl::ToDoubleNanoseconds(d) - 42;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleNanoseconds(d - absl::Nanoseconds(42))
-
-  // We can rewrite the argument of the duration conversion
-#define THIRTY absl::Seconds(30)
-  x = absl::ToDoubleSeconds(THIRTY) - 1.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleSeconds(THIRTY - absl::Seconds(1))
-#undef THIRTY
-
-  // Some other contexts
-  if (absl::ToDoubleSeconds(d) - 1.0 > 10) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: if (absl::ToDoubleSeconds(d - absl::Seconds(1)) > 10) {}
-
-  // A nested occurance
-  x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(absl::Seconds(5));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(5))
-  x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(absl::Seconds(absl::ToDoubleSeconds(d1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
-  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(absl::ToDoubleSeconds(d1)))
-
-  // These should not match
-  x = 5 - 6;
-  x = 4 - absl::ToDoubleSeconds(d) - 6.5 - 8.0;
-  x = absl::ToDoubleSeconds(d) + 1.0;
-  x = absl::ToDoubleSeconds(d) * 1.0;
-  x = absl::ToDoubleSeconds(d) / 1.0;
-
-#define MINUS_FIVE(z) absl::ToDoubleSeconds(z) - 5
-  x = MINUS_FIVE(d);
-#undef MINUS_FIVE
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp (removed)
@@ -1,111 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-duration-unnecessary-conversion %t -- -- -I %S/Inputs
-
-#include "absl/time/time.h"
-
-void f() {
-  absl::Duration d1, d2;
-
-  // Floating point
-  d2 = absl::Hours(absl::ToDoubleHours(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Minutes(absl::ToDoubleMinutes(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Seconds(absl::ToDoubleSeconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Milliseconds(absl::ToDoubleMilliseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Microseconds(absl::ToDoubleMicroseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Nanoseconds(absl::ToDoubleNanoseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-
-  // Integer point
-  d2 = absl::Hours(absl::ToInt64Hours(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Minutes(absl::ToInt64Minutes(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Seconds(absl::ToInt64Seconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Milliseconds(absl::ToInt64Milliseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Microseconds(absl::ToInt64Microseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Nanoseconds(absl::ToInt64Nanoseconds(d1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-
-  d2 = absl::Hours(d1 / absl::Hours(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Minutes(d1 / absl::Minutes(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Seconds(d1 / absl::Seconds(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Milliseconds(d1 / absl::Milliseconds(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Microseconds(d1 / absl::Microseconds(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Nanoseconds(d1 / absl::Nanoseconds(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-
-  d2 = absl::Hours(absl::FDivDuration(d1, absl::Hours(1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Minutes(absl::FDivDuration(d1, absl::Minutes(1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Seconds(absl::FDivDuration(d1, absl::Seconds(1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Milliseconds(absl::FDivDuration(d1, absl::Milliseconds(1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Microseconds(absl::FDivDuration(d1, absl::Microseconds(1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-  d2 = absl::Nanoseconds(absl::FDivDuration(d1, absl::Nanoseconds(1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: d2 = d1
-
-  // As macro argument
-#define PLUS_FIVE_S(x) x + absl::Seconds(5)
-  d2 = PLUS_FIVE_S(absl::Seconds(absl::ToInt64Seconds(d1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
-  // CHECK-FIXES: PLUS_FIVE_S(d1)
-#undef PLUS_FIVE_S
-
-  // Split by macro: should not change
-#define TOSECONDS(x) absl::Seconds(x)
-  d2 = TOSECONDS(absl::ToInt64Seconds(d1));
-#undef TOSECONDS
-
-  // Don't change something inside a macro definition
-#define VALUE(x) absl::Hours(absl::ToInt64Hours(x));
-  d2 = VALUE(d1);
-#undef VALUE
-
-  // These should not match
-  d2 = absl::Seconds(absl::ToDoubleMilliseconds(d1));
-  d2 = absl::Seconds(4);
-  int i = absl::ToInt64Milliseconds(d1);
-  d2 = absl::Hours(d1 / absl::Minutes(1));
-  d2 = absl::Seconds(d1 / absl::Seconds(30));
-  d2 = absl::Hours(absl::FDivDuration(d1, absl::Minutes(1)));
-  d2 = absl::Milliseconds(absl::FDivDuration(d1, absl::Milliseconds(20)));
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp (removed)
@@ -1,125 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-faster-strsplit-delimiter %t
-// FIXME: Fix the checker to work in C++17 mode.
-
-namespace absl {
-
-class string_view {
-  public:
-    string_view();
-    string_view(const char *);
-};
-
-namespace strings_internal {
-struct Splitter {};
-struct MaxSplitsImpl {
-  MaxSplitsImpl();
-  ~MaxSplitsImpl();
-};
-} //namespace strings_internal
-
-template <typename Delim>
-strings_internal::Splitter StrSplit(absl::string_view, Delim) {
-  return {};
-}
-template <typename Delim, typename Pred>
-strings_internal::Splitter StrSplit(absl::string_view, Delim, Pred) {
-  return {};
-}
-
-class ByAnyChar {
-  public:
-    explicit ByAnyChar(absl::string_view);
-    ~ByAnyChar();
-};
-
-template <typename Delim>
-strings_internal::MaxSplitsImpl MaxSplits(Delim, int) {
-  return {};
-}
-
-} //namespace absl
-
-void SplitDelimiters() {
-  absl::StrSplit("ABC", "A");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", 'A');
-
-  absl::StrSplit("ABC", "\x01");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", '\x01');
-
-  absl::StrSplit("ABC", "\001");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", '\001');
-
-  absl::StrSplit("ABC", R"(A)");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", 'A');
-
-  absl::StrSplit("ABC", R"(')");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", '\'');
-
-  absl::StrSplit("ABC", R"(
-)");
-  // CHECK-MESSAGES: [[@LINE-2]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", '\n');
-
-  absl::StrSplit("ABC", R"delimiter(A)delimiter");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
-  // CHECK-FIXES: absl::StrSplit("ABC", 'A');
-
-  absl::StrSplit("ABC", absl::ByAnyChar("\n"));
-  // CHECK-MESSAGES: [[@LINE-1]]:41: warning: absl::StrSplit()
-  // CHECK-FIXES: absl::StrSplit("ABC", '\n');
-
-  // Works with predicate
-  absl::StrSplit("ABC", "A", [](absl::string_view) { return true; });
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
-  // CHECK-FIXES: absl::StrSplit("ABC", 'A', [](absl::string_view) { return true; });
-
-  // Doesn't do anything with other strings lenghts.
-  absl::StrSplit("ABC", "AB");
-  absl::StrSplit("ABC", absl::ByAnyChar(""));
-  absl::StrSplit("ABC", absl::ByAnyChar(" \t"));
-
-  // Escapes a single quote in the resulting character literal.
-  absl::StrSplit("ABC", "'");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
-  // CHECK-FIXES: absl::StrSplit("ABC", '\'');
-
-  absl::StrSplit("ABC", "\"");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
-  // CHECK-FIXES: absl::StrSplit("ABC", '\"');
-
-  absl::StrSplit("ABC", absl::MaxSplits("\t", 1));
-  // CHECK-MESSAGES: [[@LINE-1]]:41: warning: absl::MaxSplits()
-  // CHECK-FIXES: absl::StrSplit("ABC", absl::MaxSplits('\t', 1));
-
-  auto delim = absl::MaxSplits(absl::ByAnyChar(" "), 1);
-  // CHECK-MESSAGES: [[@LINE-1]]:48: warning: absl::MaxSplits()
-  // CHECK-FIXES: auto delim = absl::MaxSplits(' ', 1);
-}
-
-#define MACRO(str) absl::StrSplit("ABC", str)
-
-void Macro() {
-  MACRO("A");
-}
-
-template <typename T>
-void FunctionTemplate() {
-  // This one should not warn because ByAnyChar is a dependent type.
-  absl::StrSplit("TTT", T("A"));
-
-  // This one will warn, but we are checking that we get a correct warning only
-  // once.
-  absl::StrSplit("TTT", "A");
-  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
-  // CHECK-FIXES: absl::StrSplit("TTT", 'A');
-}
-
-void FunctionTemplateCaller() {
-  FunctionTemplate<absl::ByAnyChar>();
-  FunctionTemplate<absl::string_view>();
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-no-internal-dependencies.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-no-internal-dependencies.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-no-internal-dependencies.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-no-internal-dependencies.cpp (removed)
@@ -1,48 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-no-internal-dependencies %t,  -- -- -I %S/Inputs
-// RUN: clang-tidy -checks='-*, abseil-no-internal-dependencies' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s
-
-#include "absl/strings/internal-file.h"
-#include "absl/flags/internal-file.h"
-// CHECK-NOT: warning:
-
-#include "absl/external-file.h"
-// CHECK: absl/external-file.h:6:24: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil [abseil-no-internal-dependencies]
-
-void DirectAcess() {
-  absl::strings_internal::InternalFunction();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
-
-  absl::strings_internal::InternalTemplateFunction<std::string>("a");
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
-}
-
-class FriendUsage {
-  friend struct absl::container_internal::InternalStruct;
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
-};
-
-namespace absl {
-void OpeningNamespace() {
-  strings_internal::InternalFunction();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
-}
-} // namespace absl
-
-// should not trigger warnings
-void CorrectUsage() {
-  std::string Str = absl::StringsFunction("a");
-  absl::SomeContainer b;
-}
-
-namespace absl {
-SomeContainer b;
-std::string Str = absl::StringsFunction("a");
-} // namespace absl
-
-#define USE_EXTERNAL(x) absl::strings_internal::Internal##x()
-
-void MacroUse() {
-  USE_INTERNAL(Function); // no-warning
-  USE_EXTERNAL(Function);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-no-namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-no-namespace.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-no-namespace.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-no-namespace.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -- -I %S/Inputs
-// RUN: clang-tidy -checks='-*, abseil-no-namespace' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s
-
-/// Warning will not be triggered on internal Abseil code that is included.
-#include "absl/strings/internal-file.h"
-// CHECK-NOT: warning:
-
-/// Warning will be triggered on code that is not internal that is included.
-#include "absl/external-file.h"
-// CHECK: absl/external-file.h:1:11: warning: namespace 'absl' is reserved
-
-namespace absl {}
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl' is reserved for implementation of the Abseil library and should not be opened in user code [abseil-no-namespace]
-
-namespace absl {
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl'
-namespace std {
-int i = 5;
-}
-}
-
-// Things that shouldn't trigger the check
-int i = 5;
-namespace std {}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-redundant-strcat-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-redundant-strcat-calls.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-redundant-strcat-calls.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-redundant-strcat-calls.cpp (removed)
@@ -1,188 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-redundant-strcat-calls %t
-
-int strlen(const char *);
-
-// Here we mimic the hierarchy of ::string.
-// We need to do so because we are matching on the fully qualified name of the
-// methods.
-struct __sso_string_base {};
-namespace __gnu_cxx {
-template <typename A, typename B, typename C, typename D = __sso_string_base>
-class __versa_string {
- public:
-  const char *c_str() const;
-  const char *data() const;
-  int size() const;
-  int capacity() const;
-  int length() const;
-  bool empty() const;
-  char &operator[](int);
-  void clear();
-  void resize(int);
-  int compare(const __versa_string &) const;
-};
-}  // namespace __gnu_cxx
-
-namespace std {
-template <typename T>
-class char_traits {};
-template <typename T>
-class allocator {};
-}  // namespace std
-
-template <typename A, typename B = std::char_traits<A>,
-          typename C = std::allocator<A>>
-class basic_string : public __gnu_cxx::__versa_string<A, B, C> {
- public:
-  basic_string();
-  basic_string(const basic_string &);
-  basic_string(const char *, C = C());
-  basic_string(const char *, int, C = C());
-  basic_string(const basic_string &, int, int, C = C());
-  ~basic_string();
-
-  basic_string &operator+=(const basic_string &);
-};
-
-template <typename A, typename B, typename C>
-basic_string<A, B, C> operator+(const basic_string<A, B, C> &,
-                                const basic_string<A, B, C> &);
-template <typename A, typename B, typename C>
-basic_string<A, B, C> operator+(const basic_string<A, B, C> &, const char *);
-
-typedef basic_string<char> string;
-
-bool operator==(const string &, const string &);
-bool operator==(const string &, const char *);
-bool operator==(const char *, const string &);
-
-bool operator!=(const string &, const string &);
-bool operator<(const string &, const string &);
-bool operator>(const string &, const string &);
-bool operator<=(const string &, const string &);
-bool operator>=(const string &, const string &);
-
-namespace std {
-template <typename _CharT, typename _Traits = char_traits<_CharT>,
-          typename _Alloc = allocator<_CharT>>
-class basic_string;
-
-template <typename _CharT, typename _Traits, typename _Alloc>
-class basic_string {
- public:
-  basic_string();
-  basic_string(const basic_string &);
-  basic_string(const char *, const _Alloc & = _Alloc());
-  basic_string(const char *, int, const _Alloc & = _Alloc());
-  basic_string(const basic_string &, int, int, const _Alloc & = _Alloc());
-  ~basic_string();
-
-  basic_string &operator+=(const basic_string &);
-
-  unsigned size() const;
-  unsigned length() const;
-  bool empty() const;
-};
-
-typedef basic_string<char> string;
-}  // namespace std
-
-namespace absl {
-
-class string_view {
- public:
-  typedef std::char_traits<char> traits_type;
-
-  string_view();
-  string_view(const char *);
-  string_view(const string &);
-  string_view(const char *, int);
-  string_view(string_view, int);
-
-  template <typename A>
-  explicit operator ::basic_string<char, traits_type, A>() const;
-
-  const char *data() const;
-  int size() const;
-  int length() const;
-};
-
-bool operator==(string_view A, string_view B);
-
-struct AlphaNum {
-  AlphaNum(int i);
-  AlphaNum(double f);
-  AlphaNum(const char *c_str);
-  AlphaNum(const string &str);
-  AlphaNum(const string_view &pc);
-
- private:
-  AlphaNum(const AlphaNum &);
-  AlphaNum &operator=(const AlphaNum &);
-};
-
-string StrCat(const AlphaNum &A);
-string StrCat(const AlphaNum &A, const AlphaNum &B);
-string StrCat(const AlphaNum &A, const AlphaNum &B, const AlphaNum &C);
-string StrCat(const AlphaNum &A, const AlphaNum &B, const AlphaNum &C,
-              const AlphaNum &D);
-
-// Support 5 or more arguments
-template <typename... AV>
-string StrCat(const AlphaNum &A, const AlphaNum &B, const AlphaNum &C,
-              const AlphaNum &D, const AlphaNum &E, const AV &... args);
-
-void StrAppend(string *Dest, const AlphaNum &A);
-void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B);
-void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B,
-               const AlphaNum &C);
-void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B,
-               const AlphaNum &C, const AlphaNum &D);
-
-// Support 5 or more arguments
-template <typename... AV>
-void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B,
-               const AlphaNum &C, const AlphaNum &D, const AlphaNum &E,
-               const AV &... args);
-
-}  // namespace absl
-
-using absl::AlphaNum;
-using absl::StrAppend;
-using absl::StrCat;
-
-void Positives() {
-  string S = StrCat(1, StrCat("A", StrCat(1.1)));
-  // CHECK-MESSAGES: [[@LINE-1]]:14: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
-
-  S = StrCat(StrCat(StrCat(StrCat(StrCat(1)))));
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
-
-  // TODO: should trigger. The issue here is that in the current
-  // implementation we ignore any StrCat with StrCat ancestors. Therefore
-  // inserting anything in between calls will disable triggering the deepest
-  // ones.
-  // s = StrCat(Identity(StrCat(StrCat(1, 2), StrCat(3, 4))));
-
-  StrAppend(&S, 001, StrCat(1, 2, "3"), StrCat("FOO"));
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
-
-  StrAppend(&S, 001, StrCat(StrCat(1, 2), "3"), StrCat("FOO"));
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
-
-  // Too many args. Ignore for now.
-  S = StrCat(1, 2, StrCat(3, 4, 5, 6, 7), 8, 9, 10,
-             StrCat(11, 12, 13, 14, 15, 16, 17, 18), 19, 20, 21, 22, 23, 24, 25,
-             26, 27);
-  // CHECK-MESSAGES: :[[@LINE-3]]:7: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
-  StrAppend(&S, StrCat(1, 2, 3, 4, 5), StrCat(6, 7, 8, 9, 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
-}
-
-void Negatives() {
-  // One arg. It is used for conversion. Ignore.
-  string S = StrCat(1);
-
-#define A_MACRO(x, y, z) StrCat(x, y, z)
-  S = A_MACRO(1, 2, StrCat("A", "B"));
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-str-cat-append.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-str-cat-append.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-str-cat-append.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-str-cat-append.cpp (removed)
@@ -1,129 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-str-cat-append %t
-
-typedef unsigned __INT16_TYPE__ char16;
-typedef unsigned __INT32_TYPE__ char32;
-typedef __SIZE_TYPE__ size;
-
-namespace std {
-template <typename T>
-class allocator {};
-template <typename T>
-class char_traits {};
-template <typename C, typename T, typename A>
-struct basic_string {
-  typedef basic_string<C, T, A> _Type;
-  basic_string();
-  basic_string(const C* p, const A& a = A());
-
-  const C* c_str() const;
-  const C* data() const;
-
-  _Type& append(const C* s);
-  _Type& append(const C* s, size n);
-  _Type& assign(const C* s);
-  _Type& assign(const C* s, size n);
-
-  int compare(const _Type&) const;
-  int compare(const C* s) const;
-  int compare(size pos, size len, const _Type&) const;
-  int compare(size pos, size len, const C* s) const;
-
-  size find(const _Type& str, size pos = 0) const;
-  size find(const C* s, size pos = 0) const;
-  size find(const C* s, size pos, size n) const;
-
-  _Type& insert(size pos, const _Type& str);
-  _Type& insert(size pos, const C* s);
-  _Type& insert(size pos, const C* s, size n);
-
-  _Type& operator+=(const _Type& str);
-  _Type& operator+=(const C* s);
-  _Type& operator=(const _Type& str);
-  _Type& operator=(const C* s);
-};
-
-typedef basic_string<char, std::char_traits<char>, std::allocator<char>> string;
-typedef basic_string<wchar_t, std::char_traits<wchar_t>,
-                     std::allocator<wchar_t>>
-    wstring;
-typedef basic_string<char16, std::char_traits<char16>, std::allocator<char16>>
-    u16string;
-typedef basic_string<char32, std::char_traits<char32>, std::allocator<char32>>
-    u32string;
-}  // namespace std
-
-std::string operator+(const std::string&, const std::string&);
-std::string operator+(const std::string&, const char*);
-std::string operator+(const char*, const std::string&);
-
-bool operator==(const std::string&, const std::string&);
-bool operator==(const std::string&, const char*);
-bool operator==(const char*, const std::string&);
-
-namespace llvm {
-struct StringRef {
-  StringRef(const char* p);
-  StringRef(const std::string&);
-};
-}  // namespace llvm
-
-namespace absl {
-
-struct AlphaNum {
-  AlphaNum(int i);
-  AlphaNum(double f);
-  AlphaNum(const char* c_str);
-  AlphaNum(const std::string& str);
-
- private:
-  AlphaNum(const AlphaNum&);
-  AlphaNum& operator=(const AlphaNum&);
-};
-
-std::string StrCat(const AlphaNum& A);
-std::string StrCat(const AlphaNum& A, const AlphaNum& B);
-
-template <typename A>
-void Foo(A& a) {
-  a = StrCat(a);
-}
-
-void Bar() {
-  std::string A, B;
-  Foo<std::string>(A);
-
-  std::string C = StrCat(A);
-  A = StrCat(A);
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: call to 'absl::StrCat' has no effect
-  A = StrCat(A, B);
-// CHECK-MESSAGES: [[@LINE-1]]:3: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
-// CHECK-FIXES: {{^}}  absl::StrAppend(&A, B);
-  B = StrCat(A, B);
-
-#define M(X) X = StrCat(X, A)
-  M(B);
-// CHECK-MESSAGES: [[@LINE-1]]:5: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
-// CHECK-FIXES: #define M(X) X = StrCat(X, A)
-}
-
-void Regression_SelfAppend() {
-  std::string A;
-  A = StrCat(A, A);
-}
-
-}  // namespace absl
-
-void OutsideAbsl() {
-  std::string A, B;
-  A = absl::StrCat(A, B);
-// CHECK-MESSAGES: [[@LINE-1]]:3: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
-// CHECK-FIXES: {{^}}  absl::StrAppend(&A, B);
-}
-
-void OutsideUsingAbsl() {
-  std::string A, B;
-  using absl::StrCat;
-  A = StrCat(A, B);
-// CHECK-MESSAGES: [[@LINE-1]]:3: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
-// CHECK-FIXES: {{^}}  absl::StrAppend(&A, B);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-string-find-startswith.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-string-find-startswith.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-string-find-startswith.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-string-find-startswith.cpp (removed)
@@ -1,69 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-string-find-startswith %t -- \
-// RUN:   -config="{CheckOptions: [{key: 'abseil-string-find-startswith.StringLikeClasses', value: '::std::basic_string;::basic_string'}]}"
-
-namespace std {
-template <typename T> class allocator {};
-template <typename T> class char_traits {};
-template <typename C, typename T = std::char_traits<C>,
-          typename A = std::allocator<C>>
-struct basic_string {
-  basic_string();
-  basic_string(const basic_string &);
-  basic_string(const C *, const A &a = A());
-  ~basic_string();
-  int find(basic_string<C> s, int pos = 0);
-  int find(const char *s, int pos = 0);
-};
-typedef basic_string<char> string;
-typedef basic_string<wchar_t> wstring;
-
-struct cxx_string {
-  int find(const char *s, int pos = 0);
-};
-} // namespace std
-
-struct basic_string : public std::cxx_string {
-  basic_string();
-};
-typedef basic_string global_string;
-
-std::string foo(std::string);
-std::string bar();
-
-#define A_MACRO(x, y) ((x) == (y))
-
-void tests(std::string s, global_string s2) {
-  s.find("a") == 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith instead of find() == 0 [abseil-string-find-startswith]
-  // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, "a");{{$}}
-
-  s.find(s) == 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
-  // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, s);{{$}}
-
-  s.find("aaa") != 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
-  // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "aaa");{{$}}
-
-  s.find(foo(foo(bar()))) != 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
-  // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, foo(foo(bar())));{{$}}
-
-  if (s.find("....") == 0) { /* do something */ }
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use absl::StartsWith
-  // CHECK-FIXES: {{^[[:space:]]*}}if (absl::StartsWith(s, "....")) { /* do something */ }{{$}}
-
-  0 != s.find("a");
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
-  // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "a");{{$}}
-
-  s2.find("a") == 0;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
-  // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s2, "a");{{$}}
-
-  // expressions that don't trigger the check are here.
-  A_MACRO(s.find("a"), 0);
-  s.find("a", 1) == 0;
-  s.find("a", 1) == 1;
-  s.find("a") == 1;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-time-comparison.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-time-comparison.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-time-comparison.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-time-comparison.cpp (removed)
@@ -1,129 +0,0 @@
-// RUN: %check_clang_tidy %s abseil-time-comparison %t -- -- -I%S/Inputs
-
-#include "absl/time/time.h"
-
-void f() {
-  double x;
-  absl::Duration d1, d2;
-  bool b;
-  absl::Time t1, t2;
-
-  // Check against the RHS
-  b = x > absl::ToUnixSeconds(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixSeconds(x) > t1;
-  b = x >= absl::ToUnixSeconds(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixSeconds(x) >= t1;
-  b = x == absl::ToUnixSeconds(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixSeconds(x) == t1;
-  b = x <= absl::ToUnixSeconds(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixSeconds(x) <= t1;
-  b = x < absl::ToUnixSeconds(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixSeconds(x) < t1;
-  b = x == absl::ToUnixSeconds(t1 - d2);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixSeconds(x) == t1 - d2;
-  b = absl::ToUnixSeconds(t1) > absl::ToUnixSeconds(t2);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 > t2;
-
-  // Check against the LHS
-  b = absl::ToUnixSeconds(t1) < x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 < absl::FromUnixSeconds(x);
-  b = absl::ToUnixSeconds(t1) <= x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 <= absl::FromUnixSeconds(x);
-  b = absl::ToUnixSeconds(t1) == x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 == absl::FromUnixSeconds(x);
-  b = absl::ToUnixSeconds(t1) >= x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 >= absl::FromUnixSeconds(x);
-  b = absl::ToUnixSeconds(t1) > x;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 > absl::FromUnixSeconds(x);
-
-  // Comparison against zero
-  b = absl::ToUnixSeconds(t1) < 0.0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 < absl::UnixEpoch();
-  b = absl::ToUnixSeconds(t1) < 0;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: t1 < absl::UnixEpoch();
-
-  // Scales other than Seconds
-  b = x > absl::ToUnixMicros(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixMicros(x) > t1;
-  b = x >= absl::ToUnixMillis(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixMillis(x) >= t1;
-  b = x == absl::ToUnixNanos(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixNanos(x) == t1;
-  b = x <= absl::ToUnixMinutes(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixMinutes(x) <= t1;
-  b = x < absl::ToUnixHours(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixHours(x) < t1;
-
-  // A long expression
-  bool some_condition;
-  int very_very_very_very_long_variable_name;
-  absl::Time SomeTime;
-  if (some_condition && very_very_very_very_long_variable_name
-     < absl::ToUnixSeconds(SomeTime)) {
-  // CHECK-MESSAGES: [[@LINE-2]]:25: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: if (some_condition && absl::FromUnixSeconds(very_very_very_very_long_variable_name) < SomeTime) {
-    return;
-  }
-
-  // A complex expression
-  int y;
-  b = (y + 5) * 10 > absl::ToUnixMillis(t1);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: absl::FromUnixMillis((y + 5) * 10) > t1;
-
-  // We should still transform the expression inside this macro invocation
-#define VALUE_IF(v, e) v ? (e) : 0
-  int a = VALUE_IF(1, 5 > absl::ToUnixSeconds(t1));
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: VALUE_IF(1, absl::FromUnixSeconds(5) > t1);
-#undef VALUE_IF
-
-#define VALUE_IF_2(e) (e)
-#define VALUE_IF(v, e) v ? VALUE_IF_2(e) : VALUE_IF_2(0)
-  int a2 = VALUE_IF(1, 5 > absl::ToUnixSeconds(t1));
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: perform comparison in the time domain [abseil-time-comparison]
-  // CHECK-FIXES: VALUE_IF(1, absl::FromUnixSeconds(5) > t1);
-#undef VALUE_IF
-#undef VALUE_IF_2
-
-#define VALUE_IF_2(e) (e)
-#define VALUE_IF(v, e, type) (v ? VALUE_IF_2(absl::To##type##Seconds(e)) : 0)
-  int a3 = VALUE_IF(1, t1, Unix);
-#undef VALUE_IF
-#undef VALUE_IF_2
-
-#define VALUE_IF_2(e) (e)
-#define VALUE_IF(v, e, type) (v ? (5 > VALUE_IF_2(absl::To##type##Seconds(e))) : 0)
-  int a4 = VALUE_IF(1, t1, Unix);
-#undef VALUE_IF
-#undef VALUE_IF_2
-
-  // These should not match
-  b = 6 < 4;
-
-#define TODOUBLE(x) absl::ToUnixSeconds(x)
-  b = 5.0 > TODOUBLE(t1);
-#undef TODOUBLE
-#define THIRTY 30.0
-  b = THIRTY > absl::ToUnixSeconds(t1);
-#undef THIRTY
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-time-subtraction.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-time-subtraction.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-time-subtraction.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-time-subtraction.cpp (removed)
@@ -1,118 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-time-subtraction %t -- -- -I %S/Inputs
-// FIXME: Fix the checker to work in C++17 mode.
-
-#include "absl/time/time.h"
-
-void g(absl::Duration d);
-
-void f() {
-  absl::Time t;
-  int x, y;
-  absl::Duration d;
-
-  d = absl::Hours(absl::ToUnixHours(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixHours(x));
-  d = absl::Minutes(absl::ToUnixMinutes(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixMinutes(x));
-  d = absl::Seconds(absl::ToUnixSeconds(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixSeconds(x));
-  d = absl::Milliseconds(absl::ToUnixMillis(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixMillis(x));
-  d = absl::Microseconds(absl::ToUnixMicros(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixMicros(x));
-  d = absl::Nanoseconds(absl::ToUnixNanos(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixNanos(x));
-
-  y = x - absl::ToUnixHours(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: y = absl::ToInt64Hours(absl::FromUnixHours(x) - t);
-  y = x - absl::ToUnixMinutes(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: y = absl::ToInt64Minutes(absl::FromUnixMinutes(x) - t);
-  y = x - absl::ToUnixSeconds(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: y = absl::ToInt64Seconds(absl::FromUnixSeconds(x) - t);
-  y = x - absl::ToUnixMillis(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: y = absl::ToInt64Milliseconds(absl::FromUnixMillis(x) - t);
-  y = x - absl::ToUnixMicros(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: y = absl::ToInt64Microseconds(absl::FromUnixMicros(x) - t);
-  y = x - absl::ToUnixNanos(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: y = absl::ToInt64Nanoseconds(absl::FromUnixNanos(x) - t);
-
-  // Check parenthesis placement
-  d = 5 * absl::Seconds(absl::ToUnixSeconds(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = 5 * (t - absl::FromUnixSeconds(x));
-  d = absl::Seconds(absl::ToUnixSeconds(t) - x) / 5;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixSeconds(x)) / 5;
-
-  // No extra parens around arguments
-  g(absl::Seconds(absl::ToUnixSeconds(t) - x));
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: g(t - absl::FromUnixSeconds(x));
-  g(absl::Seconds(x - absl::ToUnixSeconds(t)));
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: g(absl::FromUnixSeconds(x) - t);
-
-  // More complex subexpressions
-  d = absl::Hours(absl::ToUnixHours(t) - 5 * x);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: d = (t - absl::FromUnixHours(5 * x));
-
-  // These should not trigger; they are likely bugs
-  d = absl::Milliseconds(absl::ToUnixSeconds(t) - x);
-  d = absl::Seconds(absl::ToUnixMicros(t) - x);
-
-  // Various macro scenarios
-#define SUB(z, t1) z - absl::ToUnixSeconds(t1)
-  y = SUB(x, t);
-#undef SUB
-
-#define MILLIS(t1) absl::ToUnixMillis(t1)
-  y = x - MILLIS(t);
-#undef MILLIS
-
-#define HOURS(z) absl::Hours(z)
-  d = HOURS(absl::ToUnixHours(t) - x);
-#undef HOURS
-
-  // This should match the expression inside the macro invocation.
-#define SECONDS(z) absl::Seconds(z)
-  d = SECONDS(x - absl::ToUnixSeconds(t));
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: SECONDS(absl::ToInt64Seconds(absl::FromUnixSeconds(x) - t))
-#undef SECONDS
-}
-
-template<typename T>
-void func(absl::Time t, T x) {
-  absl::Duration d = absl::Seconds(absl::ToUnixSeconds(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:22: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: absl::Duration d = t - absl::FromUnixSeconds(x);
-}
-
-void g() {
-  func(absl::Now(), 5);
-}
-
-absl::Duration parens_in_return() {
-  absl::Time t;
-  int x;
-
-  return absl::Seconds(absl::ToUnixSeconds(t) - x);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: return t - absl::FromUnixSeconds(x);
-  return absl::Seconds(x - absl::ToUnixSeconds(t));
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: perform subtraction in the time domain [abseil-time-subtraction]
-  // CHECK-FIXES: return absl::FromUnixSeconds(x) - t;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/abseil-upgrade-duration-conversions.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-upgrade-duration-conversions.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-upgrade-duration-conversions.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-upgrade-duration-conversions.cpp (removed)
@@ -1,466 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-upgrade-duration-conversions %t -- -- -I%S/Inputs
-// FIXME: Fix the checker to work in C++17 mode.
-
-using int64_t = long long;
-
-#include "absl/time/time.h"
-
-template <typename T> struct ConvertibleTo {
-  operator T() const;
-};
-
-template <typename T>
-ConvertibleTo<T> operator+(ConvertibleTo<T>, ConvertibleTo<T>);
-
-template <typename T>
-ConvertibleTo<T> operator*(ConvertibleTo<T>, ConvertibleTo<T>);
-
-void arithmeticOperatorBasicPositive() {
-  absl::Duration d;
-  d *= ConvertibleTo<int64_t>();
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int64_t>());
-  d /= ConvertibleTo<int64_t>();
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d /= static_cast<int64_t>(ConvertibleTo<int64_t>());
-  d = ConvertibleTo<int64_t>() * d;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = static_cast<int64_t>(ConvertibleTo<int64_t>()) * d;
-  d = d * ConvertibleTo<int64_t>();
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = d * static_cast<int64_t>(ConvertibleTo<int64_t>());
-  d = d / ConvertibleTo<int64_t>();
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = d / static_cast<int64_t>(ConvertibleTo<int64_t>());
-  d.operator*=(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d.operator*=(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  d.operator/=(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d.operator/=(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  d = operator*(ConvertibleTo<int64_t>(), d);
-  // CHECK-MESSAGES: [[@LINE-1]]:17: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = operator*(static_cast<int64_t>(ConvertibleTo<int64_t>()), d);
-  d = operator*(d, ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = operator*(d, static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  d = operator/(d, ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = operator/(d, static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  ConvertibleTo<int64_t> c;
-  d *= (c + c) * c + c;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>((c + c) * c + c)
-  d /= (c + c) * c + c;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d /= static_cast<int64_t>((c + c) * c + c)
-  d = d * c * c;
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = d * static_cast<int64_t>(c) * static_cast<int64_t>(c)
-  d = c * d * c;
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = static_cast<int64_t>(c) * d * static_cast<int64_t>(c)
-  d = d / c * c;
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = d / static_cast<int64_t>(c) * static_cast<int64_t>(c)
-}
-
-void arithmeticOperatorBasicNegative() {
-  absl::Duration d;
-  d *= char{1};
-  d *= 1;
-  d *= int64_t{1};
-  d *= 1.0f;
-  d *= 1.0;
-  d *= 1.0l;
-  d /= char{1};
-  d /= 1;
-  d /= int64_t{1};
-  d /= 1.0f;
-  d /= 1.0;
-  d /= 1.0l;
-  d = d * char{1};
-  d = d * 1;
-  d = d * int64_t{1};
-  d = d * 1.0f;
-  d = d * 1.0;
-  d = d * 1.0l;
-  d = char{1} * d;
-  d = 1 * d;
-  d = int64_t{1} * d;
-  d = 1.0f * d;
-  d = 1.0 * d;
-  d = 1.0l * d;
-  d = d / char{1};
-  d = d / 1;
-  d = d / int64_t{1};
-  d = d / 1.0f;
-  d = d / 1.0;
-  d = d / 1.0l;
-
-  d *= static_cast<int>(ConvertibleTo<int>());
-  d *= (int)ConvertibleTo<int>();
-  d *= int(ConvertibleTo<int>());
-  d /= static_cast<int>(ConvertibleTo<int>());
-  d /= (int)ConvertibleTo<int>();
-  d /= int(ConvertibleTo<int>());
-  d = static_cast<int>(ConvertibleTo<int>()) * d;
-  d = (int)ConvertibleTo<int>() * d;
-  d = int(ConvertibleTo<int>()) * d;
-  d = d * static_cast<int>(ConvertibleTo<int>());
-  d = d * (int)ConvertibleTo<int>();
-  d = d * int(ConvertibleTo<int>());
-  d = d / static_cast<int>(ConvertibleTo<int>());
-  d = d / (int)ConvertibleTo<int>();
-  d = d / int(ConvertibleTo<int>());
-
-  d *= 1 + ConvertibleTo<int>();
-  d /= 1 + ConvertibleTo<int>();
-  d = (1 + ConvertibleTo<int>()) * d;
-  d = d * (1 + ConvertibleTo<int>());
-  d = d / (1 + ConvertibleTo<int>());
-}
-
-template <typename T> void templateForOpsSpecialization(T) {}
-template <>
-void templateForOpsSpecialization<absl::Duration>(absl::Duration d) {
-  d *= ConvertibleTo<int64_t>();
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int64_t>());
-}
-
-template <int N> void arithmeticNonTypeTemplateParamSpecialization() {
-  absl::Duration d;
-  d *= N;
-}
-
-template <> void arithmeticNonTypeTemplateParamSpecialization<5>() {
-  absl::Duration d;
-  d *= ConvertibleTo<int>();
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int>());
-}
-
-template <typename T> void templateOpsFix() {
-  absl::Duration d;
-  d *= ConvertibleTo<int64_t>();
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int64_t>());
-}
-
-template <typename T, typename U> void templateOpsWarnOnly(T t, U u) {
-  t *= u;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  absl::Duration d;
-  d *= u;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-}
-
-template <typename T> struct TemplateTypeOpsWarnOnly {
-  void memberA(T t) {
-    d *= t;
-    // CHECK-MESSAGES: [[@LINE-1]]:10: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  }
-  template <typename U, typename V> void memberB(U u, V v) {
-    u *= v;
-    // CHECK-MESSAGES: [[@LINE-1]]:10: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-    d *= v;
-    // CHECK-MESSAGES: [[@LINE-1]]:10: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  }
-
-  absl::Duration d;
-};
-
-template <typename T, typename U>
-void templateOpsInstantiationBeforeDefinition(T t, U u);
-
-void arithmeticOperatorsInTemplates() {
-  templateForOpsSpecialization(5);
-  templateForOpsSpecialization(absl::Duration());
-  arithmeticNonTypeTemplateParamSpecialization<1>();
-  arithmeticNonTypeTemplateParamSpecialization<5>();
-  templateOpsFix<int>();
-  templateOpsWarnOnly(absl::Duration(), ConvertibleTo<int>());
-  templateOpsInstantiationBeforeDefinition(absl::Duration(),
-                                           ConvertibleTo<int>());
-  TemplateTypeOpsWarnOnly<ConvertibleTo<int>> t;
-  t.memberA(ConvertibleTo<int>());
-  t.memberB(absl::Duration(), ConvertibleTo<int>());
-}
-
-template <typename T, typename U>
-void templateOpsInstantiationBeforeDefinition(T t, U u) {
-  t *= u;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  absl::Duration d;
-  d *= u;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-}
-
-#define FUNCTION_MACRO(x) x
-#define CONVERTIBLE_TMP ConvertibleTo<int>()
-#define ONLY_WARN_INSIDE_MACRO_ARITHMETIC_OP d *= ConvertibleTo<int>()
-
-#define T_OBJECT T()
-#define T_CALL_EXPR d *= T()
-
-template <typename T> void arithmeticTemplateAndMacro() {
-  absl::Duration d;
-  d *= T_OBJECT;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  d *= CONVERTIBLE_TMP;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(CONVERTIBLE_TMP);
-  T_CALL_EXPR;
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-}
-
-#define TEMPLATE_MACRO(type)                                                   \
-  template <typename T> void TemplateInMacro(T t) {                            \
-    type d;                                                                    \
-    d *= t;                                                                    \
-  }
-
-TEMPLATE_MACRO(absl::Duration)
-// CHECK-MESSAGES: [[@LINE-1]]:1: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-
-void arithmeticOperatorsInMacros() {
-  absl::Duration d;
-  d = FUNCTION_MACRO(d * ConvertibleTo<int>());
-  // CHECK-MESSAGES: [[@LINE-1]]:26: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d = FUNCTION_MACRO(d * static_cast<int64_t>(ConvertibleTo<int>()));
-  d *= FUNCTION_MACRO(ConvertibleTo<int>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(FUNCTION_MACRO(ConvertibleTo<int>()));
-  d *= CONVERTIBLE_TMP;
-  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: d *= static_cast<int64_t>(CONVERTIBLE_TMP);
-  ONLY_WARN_INSIDE_MACRO_ARITHMETIC_OP;
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  arithmeticTemplateAndMacro<ConvertibleTo<int>>();
-  TemplateInMacro(ConvertibleTo<int>());
-}
-
-void factoryFunctionPositive() {
-  // User defined conversion:
-  (void)absl::Nanoseconds(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  (void)absl::Microseconds(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Microseconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  (void)absl::Milliseconds(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Milliseconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  (void)absl::Seconds(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Seconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  (void)absl::Minutes(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Minutes(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-  (void)absl::Hours(ConvertibleTo<int64_t>());
-  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Hours(static_cast<int64_t>(ConvertibleTo<int64_t>()));
-
-  // User defined conversion to integral type, followed by built-in conversion:
-  (void)absl::Nanoseconds(ConvertibleTo<char>());
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<char>()));
-  (void)absl::Microseconds(ConvertibleTo<char>());
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Microseconds(static_cast<int64_t>(ConvertibleTo<char>()));
-  (void)absl::Milliseconds(ConvertibleTo<char>());
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Milliseconds(static_cast<int64_t>(ConvertibleTo<char>()));
-  (void)absl::Seconds(ConvertibleTo<char>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Seconds(static_cast<int64_t>(ConvertibleTo<char>()));
-  (void)absl::Minutes(ConvertibleTo<char>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Minutes(static_cast<int64_t>(ConvertibleTo<char>()));
-  (void)absl::Hours(ConvertibleTo<char>());
-  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Hours(static_cast<int64_t>(ConvertibleTo<char>()));
-
-  // User defined conversion to floating point type, followed by built-in conversion:
-  (void)absl::Nanoseconds(ConvertibleTo<float>());
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<float>()));
-  (void)absl::Microseconds(ConvertibleTo<float>());
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Microseconds(static_cast<int64_t>(ConvertibleTo<float>()));
-  (void)absl::Milliseconds(ConvertibleTo<float>());
-  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Milliseconds(static_cast<int64_t>(ConvertibleTo<float>()));
-  (void)absl::Seconds(ConvertibleTo<float>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Seconds(static_cast<int64_t>(ConvertibleTo<float>()));
-  (void)absl::Minutes(ConvertibleTo<float>());
-  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Minutes(static_cast<int64_t>(ConvertibleTo<float>()));
-  (void)absl::Hours(ConvertibleTo<float>());
-  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Hours(static_cast<int64_t>(ConvertibleTo<float>()));
-}
-
-void factoryFunctionNegative() {
-  (void)absl::Nanoseconds(char{1});
-  (void)absl::Nanoseconds(1);
-  (void)absl::Nanoseconds(int64_t{1});
-  (void)absl::Nanoseconds(1.0f);
-  (void)absl::Microseconds(char{1});
-  (void)absl::Microseconds(1);
-  (void)absl::Microseconds(int64_t{1});
-  (void)absl::Microseconds(1.0f);
-  (void)absl::Milliseconds(char{1});
-  (void)absl::Milliseconds(1);
-  (void)absl::Milliseconds(int64_t{1});
-  (void)absl::Milliseconds(1.0f);
-  (void)absl::Seconds(char{1});
-  (void)absl::Seconds(1);
-  (void)absl::Seconds(int64_t{1});
-  (void)absl::Seconds(1.0f);
-  (void)absl::Minutes(char{1});
-  (void)absl::Minutes(1);
-  (void)absl::Minutes(int64_t{1});
-  (void)absl::Minutes(1.0f);
-  (void)absl::Hours(char{1});
-  (void)absl::Hours(1);
-  (void)absl::Hours(int64_t{1});
-  (void)absl::Hours(1.0f);
-
-  (void)absl::Nanoseconds(static_cast<int>(ConvertibleTo<int>()));
-  (void)absl::Microseconds(static_cast<int>(ConvertibleTo<int>()));
-  (void)absl::Milliseconds(static_cast<int>(ConvertibleTo<int>()));
-  (void)absl::Seconds(static_cast<int>(ConvertibleTo<int>()));
-  (void)absl::Minutes(static_cast<int>(ConvertibleTo<int>()));
-  (void)absl::Hours(static_cast<int>(ConvertibleTo<int>()));
-}
-
-template <typename T> void templateForFactorySpecialization(T) {}
-template <> void templateForFactorySpecialization<ConvertibleTo<int>>(ConvertibleTo<int> c) {
-  (void)absl::Nanoseconds(c);
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(c));
-}
-
-template <int N> void factoryNonTypeTemplateParamSpecialization() {
-  (void)absl::Nanoseconds(N);
-}
-
-template <> void factoryNonTypeTemplateParamSpecialization<5>() {
-  (void)absl::Nanoseconds(ConvertibleTo<int>());
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<int>()));
-}
-
-template <typename T> void templateFactoryFix() {
-  (void)absl::Nanoseconds(ConvertibleTo<int>());
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<int>()));
-}
-
-template <typename T> void templateFactoryWarnOnly(T t) {
-  (void)absl::Nanoseconds(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-}
-
-template <typename T> void templateFactoryInstantiationBeforeDefinition(T t);
-
-template <typename T> struct TemplateTypeFactoryWarnOnly {
-  void memberA(T t) {
-    (void)absl::Nanoseconds(t);
-    // CHECK-MESSAGES: [[@LINE-1]]:29: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  }
-  template <typename U> void memberB(U u) {
-    (void)absl::Nanoseconds(u);
-    // CHECK-MESSAGES: [[@LINE-1]]:29: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  }
-};
-
-void factoryInTemplates() {
-  templateForFactorySpecialization(5);
-  templateForFactorySpecialization(ConvertibleTo<int>());
-  factoryNonTypeTemplateParamSpecialization<1>();
-  factoryNonTypeTemplateParamSpecialization<5>();
-  templateFactoryFix<int>();
-  templateFactoryWarnOnly(ConvertibleTo<int>());
-  templateFactoryInstantiationBeforeDefinition(ConvertibleTo<int>());
-  TemplateTypeFactoryWarnOnly<ConvertibleTo<int>> t;
-  t.memberA(ConvertibleTo<int>());
-  t.memberB(ConvertibleTo<int>());
-}
-
-template <typename T> void templateFactoryInstantiationBeforeDefinition(T t) {
-  (void)absl::Nanoseconds(t);
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-}
-
-#define ONLY_WARN_INSIDE_MACRO_FACTORY                                         \
-  (void)absl::Nanoseconds(ConvertibleTo<int>())
-#define T_CALL_FACTORTY_INSIDE_MACRO (void)absl::Nanoseconds(T())
-
-template <typename T> void factoryTemplateAndMacro() {
-  (void)absl::Nanoseconds(T_OBJECT);
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  (void)absl::Nanoseconds(CONVERTIBLE_TMP);
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(CONVERTIBLE_TMP))
-  T_CALL_FACTORTY_INSIDE_MACRO;
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-}
-
-#define TEMPLATE_FACTORY_MACRO(factory)                                        \
-  template <typename T> void TemplateFactoryInMacro(T t) { (void)factory(t); }
-
-TEMPLATE_FACTORY_MACRO(absl::Nanoseconds)
-// CHECK-MESSAGES: [[@LINE-1]]:1: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-
-void factoryInMacros() {
-  (void)absl::Nanoseconds(FUNCTION_MACRO(ConvertibleTo<int>()));
-  // CHECK-MESSAGES: [[@LINE-1]]:42: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(FUNCTION_MACRO(ConvertibleTo<int>())));
-  (void)absl::Nanoseconds(CONVERTIBLE_TMP);
-  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(CONVERTIBLE_TMP))
-  ONLY_WARN_INSIDE_MACRO_FACTORY;
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
-  factoryTemplateAndMacro<ConvertibleTo<int>>();
-  TemplateFactoryInMacro(ConvertibleTo<int>());
-}
-
-// This is a reduced test-case for PR39949 and manifested in this check.
-namespace std {
-template <typename _Tp>
-_Tp declval();
-
-template <typename _Functor, typename... _ArgTypes>
-struct __res {
-  template <typename... _Args>
-  static decltype(declval<_Functor>()(_Args()...)) _S_test(int);
-
-  template <typename...>
-  static void _S_test(...);
-
-  typedef decltype(_S_test<_ArgTypes...>(0)) type;
-};
-
-template <typename>
-struct function;
-
-template <typename... _ArgTypes>
-struct function<void(_ArgTypes...)> {
-  template <typename _Functor,
-            typename = typename __res<_Functor, _ArgTypes...>::type>
-  function(_Functor) {}
-};
-} // namespace std
-
-typedef std::function<void(void)> F;
-
-F foo() {
-  return F([] {});
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/alternative-fixes.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/alternative-fixes.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/alternative-fixes.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/alternative-fixes.cpp (removed)
@@ -1,9 +0,0 @@
-// RUN: %check_clang_tidy %s "llvm-namespace-comment,clang-diagnostic-*" %t
-void foo(int a) {
-  if (a = 1) {
-  // CHECK-NOTES: [[@LINE-1]]:9: warning: using the result of an assignment as a condition without parentheses [clang-diagnostic-parentheses]
-  // CHECK-NOTES: [[@LINE-2]]:9: note: place parentheses around the assignment to silence this warning
-  // CHECK-NOTES: [[@LINE-3]]:9: note: use '==' to turn this assignment into an equality comparison
-  // CHECK-FIXES: if ((a = 1)) {
-  }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept.cpp (removed)
@@ -1,28 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-accept %t
-
-struct sockaddr {};
-typedef int socklen_t;
-#define NULL 0
-
-extern "C" int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
-
-void f() {
-  accept(0, NULL, NULL);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer accept4() to accept() because accept4() allows SOCK_CLOEXEC [android-cloexec-accept]
-  // CHECK-FIXES: accept4(0, NULL, NULL, SOCK_CLOEXEC);
-}
-
-namespace i {
-int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
-void g() {
-  accept(0, NULL, NULL);
-}
-} // namespace i
-
-class C {
-public:
-  int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
-  void h() {
-    accept(0, NULL, NULL);
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept4.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept4.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept4.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-accept4.cpp (removed)
@@ -1,66 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-accept4 %t
-
-typedef int socklen_t;
-struct sockaddr {};
-
-#define SOCK_NONBLOCK 1
-#define __O_CLOEXEC 3
-#define SOCK_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-#define NULL 0
-
-extern "C" int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
-
-void a() {
-  accept4(0, NULL, NULL, SOCK_NONBLOCK);
-  // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: 'accept4' should use SOCK_CLOEXEC where possible [android-cloexec-accept4]
-  // CHECK-FIXES: accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC);
-  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK));
-  // CHECK-MESSAGES: :[[@LINE-1]]:58: warning: 'accept4'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC));
-}
-
-void f() {
-  accept4(0, NULL, NULL, 3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: 'accept4'
-  // CHECK-FIXES: accept4(0, NULL, NULL, 3 | SOCK_CLOEXEC);
-  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, 3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: 'accept4'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, 3 | SOCK_CLOEXEC));
-
-  int flag = SOCK_NONBLOCK;
-  accept4(0, NULL, NULL, flag);
-  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, flag));
-}
-
-namespace i {
-int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
-
-void d() {
-  accept4(0, NULL, NULL, SOCK_NONBLOCK);
-  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK));
-}
-
-} // namespace i
-
-void e() {
-  accept4(0, NULL, NULL, SOCK_CLOEXEC);
-  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_CLOEXEC));
-  accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC);
-  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC));
-}
-
-class G {
-public:
-  int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
-  void d() {
-    accept4(0, NULL, NULL, SOCK_NONBLOCK);
-    TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK));
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-creat.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-creat.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-creat.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-creat.cpp (removed)
@@ -1,35 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-creat %t
-
-typedef int mode_t;
-
-extern "C" int creat(const char *path, mode_t, ...);
-extern "C" int create(const char *path, mode_t, ...);
-
-void f() {
-  creat("filename", 0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer open() to creat() because open() allows O_CLOEXEC [android-cloexec-creat]
-  // CHECK-FIXES: open ("filename", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0);
-  create("filename", 0);
-  // CHECK-MESSAGES-NOT: warning:
-  mode_t mode = 0755;
-  creat("filename", mode);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning:
-  // CHECK-FIXES: open ("filename", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode);
-}
-
-namespace i {
-int creat(const char *path, mode_t, ...);
-void g() {
-  creat("filename", 0);
-  // CHECK-MESSAGES-NOT: warning:
-}
-} // namespace i
-
-class C {
-public:
-  int creat(const char *path, mode_t, ...);
-  void h() {
-    creat("filename", 0);
-    // CHECK-MESSAGES-NOT: warning:
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-dup.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-dup.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-dup.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-dup.cpp (removed)
@@ -1,31 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-dup %t
-
-extern "C" int dup(int oldfd);
-void f() {
-  dup(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer fcntl() to dup() because fcntl() allows F_DUPFD_CLOEXEC [android-cloexec-dup]
-  // CHECK-FIXES: fcntl(1, F_DUPFD_CLOEXEC);
-  int oldfd = 0;
-  dup(oldfd);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer
-  // CHECK-FIXES: fcntl(oldfd, F_DUPFD_CLOEXEC);
-}
-
-namespace i {
-int dup(int oldfd);
-void g() {
-  dup(0);
-  int oldfd = 1;
-  dup(oldfd);
-}
-} // namespace i
-
-class C {
-public:
-  int dup(int oldfd);
-  void h() {
-    dup(0);
-    int oldfd = 1;
-    dup(oldfd);
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-epoll-create %t
-
-extern "C" int epoll_create(int size);
-
-void f() {
-  epoll_create(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer epoll_create() to epoll_create1() because epoll_create1() allows EPOLL_CLOEXEC [android-cloexec-epoll-create]
-  // CHECK-FIXES: epoll_create1(EPOLL_CLOEXEC);
-}
-
-namespace i {
-int epoll_create(int size);
-void g() {
-  epoll_create(0);
-}
-} // namespace i
-
-class C {
-public:
-  int epoll_create(int size);
-  void h() {
-    epoll_create(0);
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create1.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create1.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create1.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-epoll-create1.cpp (removed)
@@ -1,59 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-epoll-create1 %t
-
-#define __O_CLOEXEC 3
-#define EPOLL_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-
-extern "C" int epoll_create1(int flags);
-
-void a() {
-  epoll_create1(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'epoll_create1' should use EPOLL_CLOEXEC where possible [android-cloexec-epoll-create1]
-  // CHECK-FIXES: epoll_create1(EPOLL_CLOEXEC);
-  TEMP_FAILURE_RETRY(epoll_create1(0));
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'epoll_create1'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
-}
-
-void f() {
-  epoll_create1(3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'epoll_create1'
-  // CHECK-FIXES: epoll_create1(EPOLL_CLOEXEC);
-  TEMP_FAILURE_RETRY(epoll_create1(3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'epoll_create1'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
-
-  int flag = 0;
-  epoll_create1(EPOLL_CLOEXEC);
-  TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
-}
-
-namespace i {
-int epoll_create1(int flags);
-
-void d() {
-  epoll_create1(0);
-  TEMP_FAILURE_RETRY(epoll_create1(0));
-}
-
-} // namespace i
-
-void e() {
-  epoll_create1(EPOLL_CLOEXEC);
-  TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
-}
-
-class G {
-public:
-  int epoll_create1(int flags);
-  void d() {
-    epoll_create1(EPOLL_CLOEXEC);
-    TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-fopen.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-fopen.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-fopen.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-fopen.cpp (removed)
@@ -1,57 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-fopen %t
-
-#define FILE_OPEN_RO "r"
-
-typedef int FILE;
-
-extern "C" FILE *fopen(const char *filename, const char *mode, ...);
-extern "C" FILE *open(const char *filename, const char *mode, ...);
-
-void f() {
-  fopen("filename", "r");
-  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: use 'fopen' mode 'e' to set O_CLOEXEC [android-cloexec-fopen]
-  // CHECK-FIXES: fopen("filename", "re");
-
-  fopen("filename", FILE_OPEN_RO);
-  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: use 'fopen' mode 'e'
-  // CHECK-FIXES: fopen("filename", FILE_OPEN_RO "e");
-
-  fopen("filename", "er");
-  // CHECK-MESSAGES-NOT: warning:
-  fopen("filename", "re");
-  // CHECK-MESSAGES-NOT: warning:
-  fopen("filename", "e");
-  // CHECK-MESSAGES-NOT: warning:
-  open("filename", "e");
-  // CHECK-MESSAGES-NOT: warning:
-
-  char *str = "r";
-  fopen("filename", str);
-  // CHECK-MESSAGES-NOT: warning:
-  str = "re";
-  fopen("filename", str);
-  // CHECK-MESSAGES-NOT: warning:
-  char arr[2] = "r";
-  fopen("filename", arr);
-  // CHECK-MESSAGES-NOT: warning:
-  char arr2[3] = "re";
-  fopen("filename", arr2);
-  // CHECK-MESSAGES-NOT: warning:
-}
-
-namespace i {
-int *fopen(const char *filename, const char *mode, ...);
-void g() {
-  fopen("filename", "e");
-  // CHECK-MESSAGES-NOT: warning:
-}
-} // namespace i
-
-class C {
-public:
-  int *fopen(const char *filename, const char *mode, ...);
-  void h() {
-    fopen("filename", "e");
-    // CHECK-MESSAGES-NOT: warning:
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-inotify-init %t
-
-extern "C" int inotify_init();
-
-void f() {
-  inotify_init();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer inotify_init() to inotify_init1() because inotify_init1() allows IN_CLOEXEC [android-cloexec-inotify-init]
-  // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
-}
-
-namespace i {
-int inotify_init();
-void g() {
-  inotify_init();
-}
-} // namespace i
-
-class C {
-public:
-  int inotify_init();
-  void h() {
-    inotify_init();
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init1.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init1.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init1.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-inotify-init1.cpp (removed)
@@ -1,64 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-inotify-init1 %t
-
-#define IN_NONBLOCK 1
-#define __O_CLOEXEC 3
-#define IN_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-
-extern "C" int inotify_init1(int flags);
-
-void a() {
-  inotify_init1(IN_NONBLOCK);
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: 'inotify_init1' should use IN_CLOEXEC where possible [android-cloexec-inotify-init1]
-  // CHECK-FIXES: inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
-  TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK));
-  // CHECK-MESSAGES: :[[@LINE-1]]:47: warning: 'inotify_init1'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
-}
-
-void f() {
-  inotify_init1(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'inotify_init1'
-  // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
-  TEMP_FAILURE_RETRY(inotify_init1(0));
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'inotify_init1'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
-
-  int flag = 1;
-  inotify_init1(flag);
-  TEMP_FAILURE_RETRY(inotify_init1(flag));
-}
-
-namespace i {
-int inotify_init1(int flags);
-
-void d() {
-  inotify_init1(IN_NONBLOCK);
-  TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK));
-}
-
-} // namespace i
-
-void e() {
-  inotify_init1(IN_CLOEXEC);
-  TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
-  inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
-  TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
-}
-
-class G {
-public:
-  int inotify_init1(int flags);
-  void d() {
-    inotify_init1(IN_CLOEXEC);
-    TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
-    inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
-    TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-memfd-create.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-memfd-create.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-memfd-create.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-memfd-create.cpp (removed)
@@ -1,63 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-memfd-create %t
-
-#define MFD_ALLOW_SEALING 1
-#define __O_CLOEXEC 3
-#define MFD_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-#define NULL 0
-
-extern "C" int memfd_create(const char *name, unsigned int flags);
-
-void a() {
-  memfd_create(NULL, MFD_ALLOW_SEALING);
-  // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: 'memfd_create' should use MFD_CLOEXEC where possible [android-cloexec-memfd-create]
-  // CHECK-FIXES: memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC)
-  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
-  // CHECK-MESSAGES: :[[@LINE-1]]:58: warning: 'memfd_create'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC))
-}
-
-void f() {
-  memfd_create(NULL, 3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: 'memfd_create'
-  // CHECK-FIXES: memfd_create(NULL, 3 | MFD_CLOEXEC)
-  TEMP_FAILURE_RETRY(memfd_create(NULL, 3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: 'memfd_create'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, 3 | MFD_CLOEXEC))
-
-  int flag = 3;
-  memfd_create(NULL, flag);
-  TEMP_FAILURE_RETRY(memfd_create(NULL, flag));
-}
-
-namespace i {
-int memfd_create(const char *name, unsigned int flags);
-
-void d() {
-  memfd_create(NULL, MFD_ALLOW_SEALING);
-  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
-}
-
-} // namespace i
-
-void e() {
-  memfd_create(NULL, MFD_CLOEXEC);
-  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_CLOEXEC));
-  memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC);
-  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC));
-}
-
-class G {
-public:
-  int memfd_create(const char *name, unsigned int flags);
-  void d() {
-    memfd_create(NULL, MFD_ALLOW_SEALING);
-    TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-open.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-open.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-open.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-open.cpp (removed)
@@ -1,180 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-open %t
-
-#define O_RDWR 1
-#define O_EXCL 2
-#define __O_CLOEXEC 3
-#define O_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-
-extern "C" int open(const char *fn, int flags, ...);
-extern "C" int open64(const char *fn, int flags, ...);
-extern "C" int openat(int dirfd, const char *pathname, int flags, ...);
-
-void a() {
-  open("filename", O_RDWR);
-  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: 'open' should use O_CLOEXEC where possible [android-cloexec-open]
-  // CHECK-FIXES: O_RDWR | O_CLOEXEC
-  TEMP_FAILURE_RETRY(open("filename", O_RDWR));
-  // CHECK-MESSAGES: :[[@LINE-1]]:45: warning: 'open' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_CLOEXEC
-  open("filename", O_RDWR | O_EXCL);
-  // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: 'open' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
-  TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_EXCL));
-  // CHECK-MESSAGES: :[[@LINE-1]]:54: warning: 'open' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
-}
-
-void b() {
-  open64("filename", O_RDWR);
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: 'open64' should use O_CLOEXEC where possible [android-cloexec-open]
-  // CHECK-FIXES: O_RDWR | O_CLOEXEC
-  TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
-  // CHECK-MESSAGES: :[[@LINE-1]]:47: warning: 'open64' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_CLOEXEC
-  open64("filename", O_RDWR | O_EXCL);
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'open64' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
-  TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_EXCL));
-  // CHECK-MESSAGES: :[[@LINE-1]]:56: warning: 'open64' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
-}
-
-void c() {
-  openat(0, "filename", O_RDWR);
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: 'openat' should use O_CLOEXEC where possible [android-cloexec-open]
-  // CHECK-FIXES: O_RDWR | O_CLOEXEC
-  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
-  // CHECK-MESSAGES: :[[@LINE-1]]:50: warning: 'openat' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_CLOEXEC
-  openat(0, "filename", O_RDWR | O_EXCL);
-  // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: 'openat' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
-  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_EXCL));
-  // CHECK-MESSAGES: :[[@LINE-1]]:59: warning: 'openat' should use O_CLOEXEC where
-  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
-}
-
-void f() {
-  open("filename", 3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: 'open' should use O_CLOEXEC where possible [android-cloexec-open]
-  // CHECK-FIXES: 3 | O_CLOEXEC
-  TEMP_FAILURE_RETRY(open("filename", 3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: 'open' should use O_CLOEXEC where
-  // CHECK-FIXES: 3 | O_CLOEXEC
-  open64("filename", 3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: 'open64' should use O_CLOEXEC where possible [android-cloexec-open]
-  // CHECK-FIXES: 3 | O_CLOEXEC
-  TEMP_FAILURE_RETRY(open64("filename", 3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: 'open64' should use O_CLOEXEC where
-  // CHECK-FIXES: 3 | O_CLOEXEC
-  openat(0, "filename", 3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: 'openat' should use O_CLOEXEC where possible [android-cloexec-open]
-  // CHECK-FIXES: 3 | O_CLOEXEC
-  TEMP_FAILURE_RETRY(openat(0, "filename", 3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:45: warning: 'openat' should use O_CLOEXEC where
-  // CHECK-FIXES: 3 | O_CLOEXEC
-
-  int flag = 3;
-  open("filename", flag);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open("filename", flag));
-  // CHECK-MESSAGES-NOT: warning:
-  open64("filename", flag);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open64("filename", flag));
-  // CHECK-MESSAGES-NOT: warning:
-  openat(0, "filename", flag);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(openat(0, "filename", flag));
-  // CHECK-MESSAGES-NOT: warning:
-}
-
-namespace i {
-int open(const char *pathname, int flags, ...);
-int open64(const char *pathname, int flags, ...);
-int openat(int dirfd, const char *pathname, int flags, ...);
-
-void d() {
-  open("filename", O_RDWR);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open("filename", O_RDWR));
-  // CHECK-MESSAGES-NOT: warning:
-  open64("filename", O_RDWR);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
-  // CHECK-MESSAGES-NOT: warning:
-  openat(0, "filename", O_RDWR);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
-  // CHECK-MESSAGES-NOT: warning:
-}
-
-} // namespace i
-
-void e() {
-  open("filename", O_CLOEXEC);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open("filename", O_CLOEXEC));
-  // CHECK-MESSAGES-NOT: warning:
-  open("filename", O_RDWR | O_CLOEXEC);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_CLOEXEC));
-  // CHECK-MESSAGES-NOT: warning:
-  open("filename", O_RDWR | O_CLOEXEC | O_EXCL);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_CLOEXEC | O_EXCL));
-  // CHECK-MESSAGES-NOT: warning:
-  open64("filename", O_CLOEXEC);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open64("filename", O_CLOEXEC));
-  // CHECK-MESSAGES-NOT: warning:
-  open64("filename", O_RDWR | O_CLOEXEC);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_CLOEXEC));
-  // CHECK-MESSAGES-NOT: warning:
-  open64("filename", O_RDWR | O_CLOEXEC | O_EXCL);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_CLOEXEC | O_EXCL));
-  // CHECK-MESSAGES-NOT: warning:
-  openat(0, "filename", O_CLOEXEC);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(openat(0, "filename", O_CLOEXEC));
-  // CHECK-MESSAGES-NOT: warning:
-  openat(0, "filename", O_RDWR | O_CLOEXEC);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_CLOEXEC));
-  // CHECK-MESSAGES-NOT: warning:
-  openat(0, "filename", O_RDWR | O_CLOEXEC | O_EXCL);
-  // CHECK-MESSAGES-NOT: warning:
-  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_CLOEXEC | O_EXCL));
-  // CHECK-MESSAGES-NOT: warning:
-}
-
-class G {
-public:
-  int open(const char *pathname, int flags, ...);
-  int open64(const char *pathname, int flags, ...);
-  int openat(int dirfd, const char *pathname, int flags, ...);
-
-  void h() {
-    open("filename", O_RDWR);
-    // CHECK-MESSAGES-NOT: warning:
-    TEMP_FAILURE_RETRY(open("filename", O_RDWR));
-    // CHECK-MESSAGES-NOT: warning:
-    open64("filename", O_RDWR);
-    // CHECK-MESSAGES-NOT: warning:
-    TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
-    // CHECK-MESSAGES-NOT: warning:
-    openat(0, "filename", O_RDWR);
-    // CHECK-MESSAGES-NOT: warning:
-    TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
-    // CHECK-MESSAGES-NOT: warning:
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe.cpp (removed)
@@ -1,27 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-pipe %t
-
-extern "C" int pipe(int pipefd[2]);
-
-void warning() {
-  int pipefd[2];
-  pipe(pipefd);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer pipe2() with O_CLOEXEC to avoid leaking file descriptors to child processes [android-cloexec-pipe]
-  // CHECK-FIXES: pipe2(pipefd, O_CLOEXEC);
-}
-
-namespace i {
-int pipe(int pipefd[2]);
-void noWarningInNamespace() {
-  int pipefd[2];
-  pipe(pipefd);
-}
-} // namespace i
-
-class C {
-public:
-  int pipe(int pipefd[2]);
-  void noWarningForMemberFunction() {
-    int pipefd[2];
-    pipe(pipefd);
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe2.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe2.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe2.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-pipe2.cpp (removed)
@@ -1,68 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-pipe2 %t
-
-#define O_NONBLOCK 1
-#define __O_CLOEXEC 3
-#define O_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-#define NULL 0
-
-extern "C" int pipe2(int pipefd[2], int flags);
-
-void warning() {
-  int pipefd[2];
-  pipe2(pipefd, O_NONBLOCK);
-  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: 'pipe2'
-  // CHECK-FIXES: pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
-  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: 'pipe2'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK | O_CLOEXEC));
-}
-
-void warningInMacroArugment() {
-  int pipefd[2];
-  pipe2(pipefd, 3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'pipe2'
-  // CHECK-FIXES: pipe2(pipefd, 3 | O_CLOEXEC);
-  TEMP_FAILURE_RETRY(pipe2(pipefd, 3));
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'pipe2'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(pipe2(pipefd, 3 | O_CLOEXEC));
-
-  int flag = O_NONBLOCK;
-  pipe2(pipefd, flag);
-  TEMP_FAILURE_RETRY(pipe2(pipefd, flag));
-}
-
-namespace i {
-int pipe2(int pipefd[2], int flags);
-
-void noWarning() {
-  int pipefd[2];
-  pipe2(pipefd, O_NONBLOCK);
-  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
-}
-
-} // namespace i
-
-void noWarning() {
-  int pipefd[2];
-  pipe2(pipefd, O_CLOEXEC);
-  TEMP_FAILURE_RETRY(pipe2(pipefd, O_CLOEXEC));
-  pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
-  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK | O_CLOEXEC));
-}
-
-class G {
-public:
-  int pipe2(int pipefd[2], int flags);
-  void noWarning() {
-    int pipefd[2];
-    pipe2(pipefd, O_NONBLOCK);
-    TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-cloexec-socket.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-cloexec-socket.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-cloexec-socket.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-cloexec-socket.cpp (removed)
@@ -1,75 +0,0 @@
-// RUN: %check_clang_tidy %s android-cloexec-socket %t
-
-#define SOCK_STREAM 1
-#define SOCK_DGRAM 2
-#define __O_CLOEXEC 3
-#define SOCK_CLOEXEC __O_CLOEXEC
-#define TEMP_FAILURE_RETRY(exp) \
-  ({                            \
-    int _rc;                    \
-    do {                        \
-      _rc = (exp);              \
-    } while (_rc == -1);        \
-  })
-
-extern "C" int socket(int domain, int type, int protocol);
-
-void a() {
-  socket(0, SOCK_STREAM, 0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: 'socket' should use SOCK_CLOEXEC where possible [android-cloexec-socket]
-  // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0)
-  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
-  // CHECK-MESSAGES: :[[@LINE-1]]:43: warning: 'socket'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0))
-  socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'socket'
-  // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0)
-  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
-  // CHECK-MESSAGES: :[[@LINE-1]]:56: warning: 'socket'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0))
-}
-
-void f() {
-  socket(0, 3, 0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: 'socket'
-  // CHECK-FIXES: socket(0, 3 | SOCK_CLOEXEC, 0)
-  TEMP_FAILURE_RETRY(socket(0, 3, 0));
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: 'socket'
-  // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, 3 | SOCK_CLOEXEC, 0))
-
-  int flag = 3;
-  socket(0, flag, 0);
-  TEMP_FAILURE_RETRY(socket(0, flag, 0));
-}
-
-namespace i {
-int socket(int domain, int type, int protocol);
-
-void d() {
-  socket(0, SOCK_STREAM, 0);
-  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
-  socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
-  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
-}
-
-} // namespace i
-
-void e() {
-  socket(0, SOCK_CLOEXEC, 0);
-  TEMP_FAILURE_RETRY(socket(0, SOCK_CLOEXEC, 0));
-  socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0);
-  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0));
-  socket(0, SOCK_STREAM | SOCK_CLOEXEC | SOCK_DGRAM, 0);
-  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC | SOCK_DGRAM, 0));
-}
-
-class G {
-public:
-  int socket(int domain, int type, int protocol);
-  void d() {
-    socket(0, SOCK_STREAM, 0);
-    TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
-    socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
-    TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/android-comparison-in-temp-failure-retry.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/android-comparison-in-temp-failure-retry.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/android-comparison-in-temp-failure-retry.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/android-comparison-in-temp-failure-retry.c (removed)
@@ -1,148 +0,0 @@
-// RUN: %check_clang_tidy %s android-comparison-in-temp-failure-retry %t
-
-#define TEMP_FAILURE_RETRY(x)                                                  \
-  ({                                                                           \
-    typeof(x) __z;                                                             \
-    do                                                                         \
-      __z = (x);                                                               \
-    while (__z == -1);                                                         \
-    __z;                                                                       \
-  })
-
-int foo();
-int bar(int a);
-
-void test() {
-  int i;
-  TEMP_FAILURE_RETRY((i = foo()));
-  TEMP_FAILURE_RETRY(foo());
-  TEMP_FAILURE_RETRY((foo()));
-
-  TEMP_FAILURE_RETRY(foo() == 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: top-level comparison in TEMP_FAILURE_RETRY [android-comparison-in-temp-failure-retry]
-  TEMP_FAILURE_RETRY((foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: top-level comparison in TEMP_FAILURE_RETRY
-  TEMP_FAILURE_RETRY((int)(foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-  TEMP_FAILURE_RETRY(bar(foo() == 1));
-  TEMP_FAILURE_RETRY((bar(foo() == 1)));
-  TEMP_FAILURE_RETRY((bar(foo() == 1)) == 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: top-level comparison in TEMP_FAILURE_RETRY
-  TEMP_FAILURE_RETRY(((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:41: warning: top-level comparison in TEMP_FAILURE_RETRY
-  TEMP_FAILURE_RETRY((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-#define INDIRECT TEMP_FAILURE_RETRY
-  INDIRECT(foo());
-  INDIRECT((foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: top-level comparison in TEMP_FAILURE_RETRY
-  INDIRECT(bar(foo() == 1));
-  INDIRECT((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:36: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-#define TFR(x) TEMP_FAILURE_RETRY(x)
-  TFR(foo());
-  TFR((foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: top-level comparison in TEMP_FAILURE_RETRY
-  TFR(bar(foo() == 1));
-  TFR((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-#define ADD_TFR(x) (1 + TEMP_FAILURE_RETRY(x) + 1)
-  ADD_TFR(foo());
-  ADD_TFR(foo() == 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-  ADD_TFR(bar(foo() == 1));
-  ADD_TFR((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-#define ADDP_TFR(x) (1 + TEMP_FAILURE_RETRY((x)) + 1)
-  ADDP_TFR(foo());
-  ADDP_TFR((foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-  ADDP_TFR(bar(foo() == 1));
-  ADDP_TFR((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:36: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-#define MACRO TEMP_FAILURE_RETRY(foo() == 1)
-  MACRO;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-  // Be sure that being a macro arg doesn't mess with this.
-#define ID(x) (x)
-  ID(ADDP_TFR(bar(foo() == 1)));
-  ID(ADDP_TFR(bar(foo() == 1) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: top-level comparison in TEMP_FAILURE_RETRY
-  ID(MACRO);
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: top-level comparison in TEMP_FAILURE_RETRY
-
-#define CMP(x) x == 1
-  TEMP_FAILURE_RETRY(CMP(foo()));
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: top-level comparison in TEMP_FAILURE_RETRY
-}
-
-// Be sure that it works inside of things like loops, if statements, etc.
-void control_flow() {
-  do {
-    if (TEMP_FAILURE_RETRY(foo())) {
-    }
-
-    if (TEMP_FAILURE_RETRY(foo() == 1)) {
-      // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
-    }
-
-    if (TEMP_FAILURE_RETRY(bar(foo() == 1))) {
-    }
-
-    if (TEMP_FAILURE_RETRY(bar(foo() == 1) == 1)) {
-      // CHECK-MESSAGES: :[[@LINE-1]]:44: warning: top-level comparison in TEMP_FAILURE_RETRY
-    }
-  } while (TEMP_FAILURE_RETRY(foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: top-level comparison in TEMP_FAILURE_RETRY
-}
-
-void with_nondependent_variable_type() {
-#undef TEMP_FAILURE_RETRY
-#define TEMP_FAILURE_RETRY(x)                                                  \
-  ({                                                                           \
-    long int __z;                                                              \
-    do                                                                         \
-      __z = (x);                                                               \
-    while (__z == -1);                                                         \
-    __z;                                                                       \
-  })
-
-  TEMP_FAILURE_RETRY((foo()));
-  TEMP_FAILURE_RETRY((int)(foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
-  TEMP_FAILURE_RETRY((bar(foo() == 1)));
-  TEMP_FAILURE_RETRY((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: top-level comparison in TEMP_FAILURE_RETRY
-}
-
-// I can't find a case where TEMP_FAILURE_RETRY is implemented like this, but if
-// we can cheaply support it, I don't see why not.
-void obscured_temp_failure_retry() {
-#undef TEMP_FAILURE_RETRY
-#define IMPL(x)                                                                \
-  ({                                                                           \
-    typeof(x) __z;                                                             \
-    do                                                                         \
-      __z = (x);                                                               \
-    while (__z == -1);                                                         \
-    __z;                                                                       \
-  })
-
-#define IMPL2(x) IMPL(x)
-#define TEMP_FAILURE_RETRY(x) IMPL2(x)
-  TEMP_FAILURE_RETRY((foo()));
-  TEMP_FAILURE_RETRY((int)(foo() == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
-  TEMP_FAILURE_RETRY((bar(foo() == 1)));
-  TEMP_FAILURE_RETRY((int)((bar(foo() == 1)) == 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: top-level comparison in TEMP_FAILURE_RETRY
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/basic.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/basic.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/basic.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/basic.cpp (removed)
@@ -1,6 +0,0 @@
-// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- | FileCheck %s
-// RUN: c-index-test -test-load-source-reparse 2 all %s -Xclang -add-plugin -Xclang clang-tidy -Xclang -plugin-arg-clang-tidy -Xclang -checks='-*,llvm-namespace-comment' 2>&1 | FileCheck %s
-
-namespace i {
-}
-// CHECK: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment]

Removed: clang-tools-extra/trunk/test/clang-tidy/boost-use-to-string.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/boost-use-to-string.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/boost-use-to-string.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/boost-use-to-string.cpp (removed)
@@ -1,169 +0,0 @@
-// RUN: %check_clang_tidy %s boost-use-to-string %t
-
-namespace std {
-
-template <typename T>
-class basic_string {};
-
-using string = basic_string<char>;
-using wstring = basic_string<wchar_t>;
-}
-
-namespace boost {
-template <typename T, typename V>
-T lexical_cast(const V &) {
-  return T();
-};
-}
-
-struct my_weird_type {};
-
-std::string fun(const std::string &) {}
-
-void test_to_string1() {
-
-  auto xa = boost::lexical_cast<std::string>(5);
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string instead of boost::lexical_cast<std::string> [boost-use-to-string]
-  // CHECK-FIXES: auto xa = std::to_string(5);
-
-  auto z = boost::lexical_cast<std::string>(42LL);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: use std::to_string
-  // CHECK-FIXES: auto z = std::to_string(42LL);
-
-  // this should not trigger
-  fun(boost::lexical_cast<std::string>(42.0));
-  auto non = boost::lexical_cast<my_weird_type>(42);
-  boost::lexical_cast<int>("12");
-}
-
-void test_to_string2() {
-  int a;
-  long b;
-  long long c;
-  unsigned d;
-  unsigned long e;
-  unsigned long long f;
-  float g;
-  double h;
-  long double i;
-  bool j;
-
-  fun(boost::lexical_cast<std::string>(a));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
-  // CHECK-FIXES: fun(std::to_string(a));
-  fun(boost::lexical_cast<std::string>(b));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
-  // CHECK-FIXES: fun(std::to_string(b));
-  fun(boost::lexical_cast<std::string>(c));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
-  // CHECK-FIXES: fun(std::to_string(c));
-  fun(boost::lexical_cast<std::string>(d));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
-  // CHECK-FIXES: fun(std::to_string(d));
-  fun(boost::lexical_cast<std::string>(e));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
-  // CHECK-FIXES: fun(std::to_string(e));
-  fun(boost::lexical_cast<std::string>(f));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
-  // CHECK-FIXES: fun(std::to_string(f));
-
-  // No change for floating numbers.
-  fun(boost::lexical_cast<std::string>(g));
-  fun(boost::lexical_cast<std::string>(h));
-  fun(boost::lexical_cast<std::string>(i));
-  // And bool.
-  fun(boost::lexical_cast<std::string>(j));
-}
-
-std::string fun(const std::wstring &) {}
-
-void test_to_wstring() {
-  int a;
-  long b;
-  long long c;
-  unsigned d;
-  unsigned long e;
-  unsigned long long f;
-  float g;
-  double h;
-  long double i;
-  bool j;
-
-  fun(boost::lexical_cast<std::wstring>(a));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring instead of boost::lexical_cast<std::wstring> [boost-use-to-string]
-  // CHECK-FIXES: fun(std::to_wstring(a));
-  fun(boost::lexical_cast<std::wstring>(b));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
-  // CHECK-FIXES: fun(std::to_wstring(b));
-  fun(boost::lexical_cast<std::wstring>(c));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
-  // CHECK-FIXES: fun(std::to_wstring(c));
-  fun(boost::lexical_cast<std::wstring>(d));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
-  // CHECK-FIXES: fun(std::to_wstring(d));
-  fun(boost::lexical_cast<std::wstring>(e));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
-  // CHECK-FIXES: fun(std::to_wstring(e));
-  fun(boost::lexical_cast<std::wstring>(f));
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
-  // CHECK-FIXES: fun(std::to_wstring(f));
-
-  // No change for floating numbers
-  fun(boost::lexical_cast<std::wstring>(g));
-  fun(boost::lexical_cast<std::wstring>(h));
-  fun(boost::lexical_cast<std::wstring>(i));
-  // and bool.
-  fun(boost::lexical_cast<std::wstring>(j));
-}
-
-const auto glob = boost::lexical_cast<std::string>(42);
-// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: use std::to_string
-// CHECK-FIXES: const auto glob = std::to_string(42);
-
-template <typename T>
-void string_as_T(T t = T()) {
-  boost::lexical_cast<std::string>(42);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use std::to_string
-  // CHECK-FIXES: std::to_string(42);
-
-  boost::lexical_cast<T>(42);
-  string_as_T(boost::lexical_cast<T>(42));
-  auto p = boost::lexical_cast<T>(42);
-  auto p2 = (T)boost::lexical_cast<T>(42);
-  auto p3 = static_cast<T>(boost::lexical_cast<T>(42));
-}
-
-#define my_to_string boost::lexical_cast<std::string>
-
-void no_fixup_inside_macro() {
-  my_to_string(12);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use std::to_string
-}
-
-void no_warnings() {
-  fun(boost::lexical_cast<std::string>("abc"));
-  fun(boost::lexical_cast<std::wstring>("abc"));
-  fun(boost::lexical_cast<std::string>(my_weird_type{}));
-  string_as_T<int>();
-  string_as_T<std::string>();
-}
-
-struct Fields {
-  int integer;
-  float floating;
-  Fields* wierd;
-  const int &getConstInteger() const {return integer;}
-};
-
-void testFields() {
-  Fields fields;
-  auto s1 = boost::lexical_cast<std::string>(fields.integer);
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string
-  // CHECK-FIXES: auto s1 = std::to_string(fields.integer);
-
-  auto s2 = boost::lexical_cast<std::string>(fields.floating);
-  auto s3 = boost::lexical_cast<std::string>(fields.wierd);
-  auto s4 = boost::lexical_cast<std::string>(fields.getConstInteger());
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string
-  // CHECK-FIXES: auto s4 = std::to_string(fields.getConstInteger());
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-gmock.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-gmock.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-gmock.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-gmock.cpp (removed)
@@ -1,130 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-argument-comment %t
-
-namespace testing {
-namespace internal {
-
-template <typename F>
-struct Function;
-
-template <typename R>
-struct Function<R()> {
-  typedef R Result;
-};
-
-template <typename R, typename A1>
-struct Function<R(A1)>
-    : Function<R()> {
-  typedef A1 Argument1;
-};
-
-template <typename R, typename A1, typename A2>
-struct Function<R(A1, A2)>
-    : Function<R(A1)> {
-  typedef A2 Argument2;
-};
-
-} // namespace internal
-
-template <typename F>
-class MockSpec {
- public:
-  void f();
-};
-
-template <typename T>
-class Matcher {
- public:
-  explicit Matcher();
-  Matcher(T value);
-};
-
-} // namespace testing
-
-#define GMOCK_RESULT_(tn, ...) \
-    tn ::testing::internal::Function<__VA_ARGS__>::Result
-#define GMOCK_ARG_(tn, N, ...) \
-    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
-#define GMOCK_MATCHER_(tn, N, ...) \
-    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
-#define GMOCK_METHOD2_(tn, constness, ct, Method, ...)            \
-  GMOCK_RESULT_(tn, __VA_ARGS__)                                  \
-  ct Method(                                                      \
-      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                    \
-      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness;         \
-  ::testing::MockSpec<__VA_ARGS__>                                \
-      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
-                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness
-#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
-#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
-#define GMOCK_EXPECT_CALL_IMPL_(obj, call) \
-    ((obj).gmock_##call).f()
-#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
-
-class Base {
- public:
-  virtual void Method(int param_one_base, int param_two_base);
-};
-class Derived : public Base {
- public:
-  virtual void Method(int param_one, int param_two);
-  virtual void Method2(int p_one, int p_two) const;
-};
-class MockDerived : public Derived {
- public:
-  MOCK_METHOD2(Method, void(int a, int b));
-  MOCK_CONST_METHOD2(Method2, void(int c, int d));
-};
-
-class MockStandalone {
- public:
-  MOCK_METHOD2(Method, void(int aaa, int bbb));
-};
-
-void test_gmock_expectations() {
-  MockDerived m;
-  EXPECT_CALL(m, Method(/*param_one=*/1, /*param_tw=*/2));
-// CHECK-NOTES: [[@LINE-1]]:42: warning: argument name 'param_tw' in comment does not match parameter name 'param_two'
-// CHECK-NOTES: [[@LINE-18]]:42: note: 'param_two' declared here
-// CHECK-NOTES: [[@LINE-14]]:3: note: actual callee ('gmock_Method') is declared here
-// CHECK-NOTES: [[@LINE-32]]:30: note: expanded from macro 'MOCK_METHOD2'
-// CHECK-NOTES: [[@LINE-35]]:7: note: expanded from macro 'GMOCK_METHOD2_'
-// CHECK-NOTES: note: expanded from here
-// CHECK-FIXES:   EXPECT_CALL(m, Method(/*param_one=*/1, /*param_two=*/2));
-  EXPECT_CALL(m, Method2(/*p_on=*/3, /*p_two=*/4));
-// CHECK-NOTES: [[@LINE-1]]:26: warning: argument name 'p_on' in comment does not match parameter name 'p_one'
-// CHECK-NOTES: [[@LINE-25]]:28: note: 'p_one' declared here
-// CHECK-NOTES: [[@LINE-21]]:3: note: actual callee ('gmock_Method2') is declared here
-// CHECK-NOTES: [[@LINE-39]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
-// CHECK-NOTES: [[@LINE-43]]:7: note: expanded from macro 'GMOCK_METHOD2_'
-// CHECK-NOTES: note: expanded from here
-// CHECK-FIXES:   EXPECT_CALL(m, Method2(/*p_one=*/3, /*p_two=*/4));
-
-  #define PARAM1 11
-  #define PARAM2 22
-  EXPECT_CALL(m, Method2(/*p_on1=*/PARAM1, /*p_tw2=*/PARAM2));
-// CHECK-NOTES: [[@LINE-1]]:26: warning: argument name 'p_on1' in comment does not match parameter name 'p_one'
-// CHECK-NOTES: [[@LINE-36]]:28: note: 'p_one' declared here
-// CHECK-NOTES: [[@LINE-32]]:3: note: actual callee ('gmock_Method2') is declared here
-// CHECK-NOTES: [[@LINE-50]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
-// CHECK-NOTES: [[@LINE-54]]:7: note: expanded from macro 'GMOCK_METHOD2_'
-// CHECK-NOTES: note: expanded from here
-// CHECK-NOTES: [[@LINE-7]]:44: warning: argument name 'p_tw2' in comment does not match parameter name 'p_two'
-// CHECK-NOTES: [[@LINE-42]]:39: note: 'p_two' declared here
-// CHECK-NOTES: [[@LINE-38]]:3: note: actual callee ('gmock_Method2') is declared here
-// CHECK-NOTES: [[@LINE-56]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
-// CHECK-NOTES: [[@LINE-60]]:7: note: expanded from macro 'GMOCK_METHOD2_'
-// CHECK-NOTES: note: expanded from here
-// CHECK-FIXES:   EXPECT_CALL(m, Method2(/*p_one=*/PARAM1, /*p_two=*/PARAM2));
-
-  MockStandalone m2;
-  EXPECT_CALL(m2, Method(/*aaa=*/5, /*bbc=*/6));
-}
-
-void test_gmock_direct_calls() {
-  MockDerived m;
-  m.Method(/*param_one=*/1, /*param_tw=*/2);
-// CHECK-NOTES: [[@LINE-1]]:29: warning: argument name 'param_tw' in comment does not match parameter name 'param_two'
-// CHECK-NOTES: [[@LINE-58]]:42: note: 'param_two' declared here
-// CHECK-NOTES: [[@LINE-54]]:16: note: actual callee ('Method') is declared here
-// CHECK-FIXES:   m.Method(/*param_one=*/1, /*param_two=*/2);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp (removed)
@@ -1,105 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
-// RUN:   -config="{CheckOptions: [ \
-// RUN:     {key: bugprone-argument-comment.IgnoreSingleArgument, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
-
-struct A {
-  void foo(bool abc);
-  void foo(bool abc, bool cde);
-  void foo(const char *, bool abc);
-  void foo(int iabc);
-  void foo(float fabc);
-  void foo(double dabc);
-  void foo(const char *strabc);
-  void fooW(const wchar_t *wstrabc);
-  void fooPtr(A *ptrabc);
-  void foo(char chabc);
-};
-
-#define FOO 1
-
-void g(int a);
-void h(double b);
-void i(const char *c);
-
-double operator"" _km(long double);
-
-void test() {
-  A a;
-
-  a.foo(true);
-
-  a.foo(false);
-
-  a.foo(true, false);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/true, /*cde=*/false);
-
-  a.foo(false, true);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:16: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
-
-  a.foo(/*abc=*/false, true);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
-
-  a.foo(false, /*cde=*/true);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
-
-  bool val1 = true;
-  bool val2 = false;
-  a.foo(val1, val2);
-
-  a.foo("", true);
-  // CHECK-MESSAGES: [[@LINE-1]]:13: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo("", /*abc=*/true);
-
-  a.foo(0);
-
-  a.foo(1.0f);
-
-  a.foo(1.0);
-
-  int val3 = 10;
-  a.foo(val3);
-
-  float val4 = 10.0;
-  a.foo(val4);
-
-  double val5 = 10.0;
-  a.foo(val5);
-
-  a.foo("Hello World");
-
-  a.fooW(L"Hello World");
-
-  a.fooPtr(nullptr);
-
-  a.foo(402.0_km);
-
-  a.foo('A');
-
-  g(FOO);
-
-  h(1.0f);
-
-  i(__FILE__);
-
-  g((1));
-}
-
-void f(bool _with_underscores_);
-void ignores_underscores() {
-  f(false);
-
-  f(true);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp (removed)
@@ -1,185 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
-// RUN:   -config="{CheckOptions: [ \
-// RUN:     {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
-// RUN:     {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
-
-struct A {
-  void foo(bool abc);
-  void foo(bool abc, bool cde);
-  void foo(const char *, bool abc);
-  void foo(int iabc);
-  void foo(float fabc);
-  void foo(double dabc);
-  void foo(const char *strabc);
-  void fooW(const wchar_t *wstrabc);
-  void fooPtr(A *ptrabc);
-  void foo(char chabc);
-};
-
-#define FOO 1
-#define X(x) (x)
-
-void g(int a);
-void h(double b);
-void i(const char *c);
-void j(int a, int b, int c);
-
-double operator"" _km(long double);
-
-void test() {
-  A a;
-
-  a.foo(true);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/true);
-
-  a.foo(false);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false);
-
-  a.foo(true, false);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/true, /*cde=*/false);
-
-  a.foo(false, true);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:16: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
-
-  a.foo(/*abc=*/false, true);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
-
-  a.foo(false, /*cde=*/true);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
-
-  bool val1 = true;
-  bool val2 = false;
-  a.foo(val1, val2);
-
-  a.foo("", true);
-  // CHECK-MESSAGES: [[@LINE-1]]:13: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo("", /*abc=*/true);
-
-  a.foo(0);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'iabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*iabc=*/0);
-
-  a.foo(1.0f);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'fabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*fabc=*/1.0f);
-
-  a.foo(-1.0f);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'fabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*fabc=*/-1.0f);
-
-  a.foo(1.0);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*dabc=*/1.0);
-
-  a.foo(-1.0);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*dabc=*/-1.0);
-
-  int val3 = 10;
-  a.foo(val3);
-  a.foo(-val3);
-
-  float val4 = 10.0;
-  a.foo(val4);
-  a.foo(-val4);
-
-  double val5 = 10.0;
-  a.foo(val5);
-  a.foo(-val5);
-
-  a.foo("Hello World");
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'strabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*strabc=*/"Hello World");
-  //
-  a.fooW(L"Hello World");
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: argument comment missing for literal argument 'wstrabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.fooW(/*wstrabc=*/L"Hello World");
-
-  a.fooPtr(nullptr);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: argument comment missing for literal argument 'ptrabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.fooPtr(/*ptrabc=*/nullptr);
-
-  a.foo(402.0_km);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*dabc=*/402.0_km);
-
-  a.foo(-402.0_km);
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*dabc=*/-402.0_km);
-
-  a.foo('A');
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'chabc' [bugprone-argument-comment]
-  // CHECK-FIXES: a.foo(/*chabc=*/'A');
-
-  g(FOO);
-  g(-FOO);
-  h(1.0f);
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
-  // CHECK-FIXES: h(/*b=*/1.0f);
-  h(-1.0f);
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
-  // CHECK-FIXES: h(/*b=*/-1.0f);
-  i(__FILE__);
-
-  j(1, X(1), X(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'a' [bugprone-argument-comment]
-  // CHECK-FIXES: j(/*a=*/1, X(1), X(1));
-  j(/*a=*/1, X(1), X(1));
-
-  j(X(1), 1, X(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
-  // CHECK-FIXES: j(X(1), /*b=*/1, X(1));
-  j(X(1), /*b=*/1, X(1));
-
-  j(X(1), X(1), 1);
-  // CHECK-MESSAGES: [[@LINE-1]]:17: warning: argument comment missing for literal argument 'c' [bugprone-argument-comment]
-  // CHECK-FIXES: j(X(1), X(1), /*c=*/1);
-  j(X(1), X(1), /*c=*/1);
-
-  j(X(1), 1, 1);
-  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:14: warning: argument comment missing for literal argument 'c' [bugprone-argument-comment]
-  // CHECK-FIXES: j(X(1), /*b=*/1, /*c=*/1);
-  j(X(1), /*b=*/1, /*c=*/1);
-
-  j(1, X(1), 1);
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'a' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:14: warning: argument comment missing for literal argument 'c' [bugprone-argument-comment]
-  // CHECK-FIXES: j(/*a=*/1, X(1), /*c=*/1);
-  j(/*a=*/1, X(1), /*c=*/1);
-
-  j(1, 1, X(1));
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'a' [bugprone-argument-comment]
-  // CHECK-MESSAGES: [[@LINE-2]]:8: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
-  // CHECK-FIXES: j(/*a=*/1, /*b=*/1, X(1));
-  j(/*a=*/1, /*b=*/1, X(1));
-
-  // FIXME Would like the below to add argument comments.
-  g((1));
-  // FIXME But we should not add argument comments here.
-  g(_Generic(0, int : 0));
-}
-
-void f(bool _with_underscores_);
-void ignores_underscores() {
-  f(false);
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument '_with_underscores_' [bugprone-argument-comment]
-  // CHECK-FIXES: f(/*_with_underscores_=*/false);
-
-  f(true);
-  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument
-  // CHECK-FIXES: f(/*_with_underscores_=*/true);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-strict.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-strict.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-strict.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-strict.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
-// RUN:   -config="{CheckOptions: [{key: StrictMode, value: 1}]}" --
-
-void f(int _with_underscores_);
-void g(int x_);
-void ignores_underscores() {
-  f(/*With_Underscores=*/0);
-// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'With_Underscores' in comment does not match parameter name '_with_underscores_'
-// CHECK-NOTES: [[@LINE-5]]:12: note: '_with_underscores_' declared here
-// CHECK-FIXES: f(/*_with_underscores_=*/0);
-
-  f(/*with_underscores=*/1);
-// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'with_underscores' in comment does not match parameter name '_with_underscores_'
-// CHECK-NOTES: [[@LINE-10]]:12: note: '_with_underscores_' declared here
-// CHECK-FIXES: f(/*_with_underscores_=*/1);
-  f(/*_With_Underscores_=*/2);
-// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name '_With_Underscores_' in comment does not match parameter name '_with_underscores_'
-// CHECK-NOTES: [[@LINE-14]]:12: note: '_with_underscores_' declared here
-// CHECK-FIXES: f(/*_with_underscores_=*/2);
-  g(/*X=*/3);
-// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'X' in comment does not match parameter name 'x_'
-// CHECK-NOTES: [[@LINE-17]]:12: note: 'x_' declared here
-// CHECK-FIXES: g(/*x_=*/3);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment.cpp (removed)
@@ -1,117 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-argument-comment %t
-
-// FIXME: clang-tidy should provide a -verify mode to make writing these checks
-// easier and more accurate.
-
-void ffff(int xxxx, int yyyy);
-
-void f(int x, int y);
-void g() {
-  // CHECK-NOTES: [[@LINE+4]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
-  // CHECK-NOTES: [[@LINE-3]]:12: note: 'x' declared here
-  // CHECK-NOTES: [[@LINE+2]]:14: warning: argument name 'z' in comment does not match parameter name 'y'
-  // CHECK-NOTES: [[@LINE-5]]:19: note: 'y' declared here
-  f(/*y=*/0, /*z=*/0);
-  // CHECK-FIXES: {{^}}  f(/*y=*/0, /*z=*/0);
-
-  f(/*x=*/1, /*y=*/1);
-
-  ffff(0 /*aaaa=*/, /*bbbb*/ 0); // Unsupported formats.
-}
-
-struct C {
-  C(int x, int y);
-};
-C c(/*x=*/0, /*y=*/0);
-
-struct Closure {};
-
-template <typename T1, typename T2>
-Closure *NewCallback(void (*f)(T1, T2), T1 arg1, T2 arg2) { return nullptr; }
-
-template <typename T1, typename T2>
-Closure *NewPermanentCallback(void (*f)(T1, T2), T1 arg1, T2 arg2) { return nullptr; }
-
-void h() {
-  (void)NewCallback(&ffff, /*xxxx=*/11, /*yyyy=*/22);
-  (void)NewPermanentCallback(&ffff, /*xxxx=*/11, /*yyyy=*/22);
-}
-
-template<typename... Args>
-void variadic(Args&&... args);
-
-template<typename... Args>
-void variadic2(int zzz, Args&&... args);
-
-void templates() {
-  variadic(/*xxx=*/0, /*yyy=*/1);
-  variadic2(/*zzU=*/0, /*xxx=*/1, /*yyy=*/2);
-  // CHECK-NOTES: [[@LINE-1]]:13: warning: argument name 'zzU' in comment does not match parameter name 'zzz'
-  // CHECK-NOTES: :[[@LINE-6]]:20: note: 'zzz' declared here
-  // CHECK-FIXES: variadic2(/*zzz=*/0, /*xxx=*/1, /*yyy=*/2);
-}
-
-#define FALSE 0
-void qqq(bool aaa);
-void f2() { qqq(/*bbb=*/FALSE); }
-// CHECK-NOTES: [[@LINE-1]]:17: warning: argument name 'bbb' in comment does not match parameter name 'aaa'
-// CHECK-NOTES: [[@LINE-3]]:15: note: 'aaa' declared here
-// CHECK-FIXES: void f2() { qqq(/*bbb=*/FALSE); }
-
-void f3(bool _with_underscores_);
-void ignores_underscores() {
-  f3(/*With_Underscores=*/false);
-}
-
-namespace IgnoresImplicit {
-struct S {
-  S(int x);
-  int x;
-};
-
-struct T {
-  // Use two arguments (one defaulted) because simplistic check for implicit
-  // constructor looks for only one argument. We need to default the argument so
-  // that it will still be triggered implicitly.  This is not contrived -- it
-  // comes up in real code, for example std::set(std::initializer_list...).
-  T(S s, int y = 0);
-};
-
-void k(T arg1);
-
-void mynewtest() {
-  int foo = 3;
-  k(/*arg1=*/S(foo));
-}
-} // namespace IgnoresImplicit
-
-namespace ThisEditDistanceAboveThreshold {
-void f4(int xxx);
-void g() { f4(/*xyz=*/0); }
-// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'xyz' in comment does not match parameter name 'xxx'
-// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
-// CHECK-FIXES: void g() { f4(/*xyz=*/0); }
-}
-
-namespace OtherEditDistanceAboveThreshold {
-void f5(int xxx, int yyy);
-void g() { f5(/*Zxx=*/0, 0); }
-// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'Zxx' in comment does not match parameter name 'xxx'
-// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
-// CHECK-FIXES: void g() { f5(/*xxx=*/0, 0); }
-struct C2 {
-  C2(int xxx, int yyy);
-};
-C2 c2(/*Zxx=*/0, 0);
-// CHECK-NOTES: [[@LINE-1]]:7: warning: argument name 'Zxx' in comment does not match parameter name 'xxx'
-// CHECK-NOTES: [[@LINE-4]]:10: note: 'xxx' declared here
-// CHECK-FIXES: C2 c2(/*xxx=*/0, 0);
-}
-
-namespace OtherEditDistanceBelowThreshold {
-void f6(int xxx, int yyy);
-void g() { f6(/*xxy=*/0, 0); }
-// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'xxy' in comment does not match parameter name 'xxx'
-// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
-// CHECK-FIXES: void g() { f6(/*xxy=*/0, 0); }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-assert-side-effect.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-assert-side-effect.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-assert-side-effect.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-assert-side-effect.cpp (removed)
@@ -1,114 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-assert-side-effect %t -- -config="{CheckOptions: [{key: bugprone-assert-side-effect.CheckFunctionCalls, value: 1}, {key: bugprone-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert,convoluted_assert,msvc_assert'}]}" -- -fexceptions
-
-//===--- assert definition block ------------------------------------------===//
-int abort() { return 0; }
-
-#ifdef NDEBUG
-#define assert(x) 1
-#else
-#define assert(x)                                                              \
-  if (!(x))                                                                    \
-  (void)abort()
-#endif
-
-void print(...);
-#define assert2(e) (__builtin_expect(!(e), 0) ?                                \
-                       print (#e, __FILE__, __LINE__) : (void)0)
-
-#ifdef NDEBUG
-#define my_assert(x) 1
-#else
-#define my_assert(x)                                                           \
-  ((void)((x) ? 1 : abort()))
-#endif
-
-#ifdef NDEBUG
-#define not_my_assert(x) 1
-#else
-#define not_my_assert(x)                                                       \
-  if (!(x))                                                                    \
-  (void)abort()
-#endif
-
-#define real_assert(x) ((void)((x) ? 1 : abort()))
-#define wrap1(x) real_assert(x)
-#define wrap2(x) wrap1(x)
-#define convoluted_assert(x) wrap2(x)
-
-#define msvc_assert(expression) (void)(                                        \
-            (!!(expression)) ||                                                \
-            (abort(), 0)                                                       \
-        )
-
-
-//===----------------------------------------------------------------------===//
-
-class MyClass {
-public:
-  bool badFunc(int a, int b) { return a * b > 0; }
-  bool goodFunc(int a, int b) const { return a * b > 0; }
-
-  MyClass &operator=(const MyClass &rhs) { return *this; }
-
-  int operator-() { return 1; }
-
-  operator bool() const { return true; }
-
-  void operator delete(void *p) {}
-};
-
-bool freeFunction() {
-  return true;
-}
-
-int main() {
-
-  int X = 0;
-  bool B = false;
-  assert(X == 1);
-
-  assert(X = 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect [bugprone-assert-side-effect]
-  my_assert(X = 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found my_assert() with side effect
-  convoluted_assert(X = 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found convoluted_assert() with side effect
-  not_my_assert(X = 1);
-
-  assert(++X);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-  assert(!B);
-
-  assert(B || true);
-
-  assert(freeFunction());
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-
-  MyClass mc;
-  assert(mc.badFunc(0, 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-  assert(mc.goodFunc(0, 1));
-
-  MyClass mc2;
-  assert(mc2 = mc);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-
-  assert(-mc > 0);
-
-  MyClass *mcp;
-  assert(mcp = new MyClass);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-
-  assert((delete mcp, false));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-
-  assert((throw 1, false));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
-
-  assert2(1 == 2 - 1);
-
-  msvc_assert(mc2 = mc);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found msvc_assert() with side effect
-
-  return 0;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-bool-pointer-implicit-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-bool-pointer-implicit-conversion.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-bool-pointer-implicit-conversion.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-bool-pointer-implicit-conversion.cpp (removed)
@@ -1,82 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-bool-pointer-implicit-conversion %t
-
-bool *SomeFunction();
-void SomeOtherFunction(bool*);
-bool F();
-void G(bool);
-
-
-template <typename T>
-void t(T b) {
-  if (b) {
-  }
-}
-
-void foo() {
-  bool *b = SomeFunction();
-  if (b) {
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: dubious check of 'bool *' against 'nullptr'
-// CHECK-FIXES: if (*b) {
-  }
-
-  if (F() && b) {
-// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: dubious check of 'bool *' against 'nullptr'
-// CHECK-FIXES: if (F() && *b) {
-  }
-
-  // TODO: warn here.
-  if (b) {
-    G(b);
-  }
-
-#define TESTMACRO if (b || F())
-
-  TESTMACRO {
-  }
-
-  t(b);
-
-  if (!b) {
-    // no-warning
-  }
-
-  if (SomeFunction()) {
-    // no-warning
-  }
-
-  bool *c = SomeFunction();
-  if (c) {
-    (void)c;
-    (void)*c; // no-warning
-  }
-
-  if (c) {
-    *c = true; // no-warning
-  }
-
-  if (c) {
-    c[0] = false; // no-warning
-  }
-
-  if (c) {
-    SomeOtherFunction(c); // no-warning
-  }
-
-  if (c) {
-    delete[] c; // no-warning
-  }
-
-  if (c) {
-    *(c) = false; // no-warning
-  }
-
-  struct {
-    bool *b;
-  } d = { SomeFunction() };
-
-  if (d.b)
-    (void)*d.b; // no-warning
-
-#define CHECK(b) if (b) {}
-  CHECK(c)
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone-macro-crash.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone-macro-crash.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone-macro-crash.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone-macro-crash.c (removed)
@@ -1,14 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-branch-clone %t
-int x = 0;
-int y = 1;
-#define a(b, c) \
-  typeof(b) d;  \
-  if (b)        \
-    d = b;      \
-  else if (c)   \
-    d = b;
-
-f() {
-  // CHECK-MESSAGES: warning: repeated branch in conditional chain [bugprone-branch-clone]
-  a(x, y)
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-branch-clone.cpp (removed)
@@ -1,1026 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-branch-clone %t -- -- -fno-delayed-template-parsing
-
-void test_basic1(int in, int &out) {
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  else
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    out++;
-
-  out++;
-}
-
-void test_basic2(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  }
-  else {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    out++;
-  }
-
-  out++;
-}
-
-void test_basic3(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  }
-  else
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    out++;
-
-  out++;
-}
-
-void test_basic4(int in, int &out) {
-  if (in > 77) {
-    out--;
-  }
-  else {
-    out++;
-  }
-}
-
-void test_basic5(int in, int &out) {
-  if (in > 77) {
-    out++;
-  }
-  else {
-    out++;
-    out++;
-  }
-}
-
-void test_basic6(int in, int &out) {
-  if (in > 77) {
-    out++;
-  }
-  else {
-    out++, out++;
-  }
-}
-
-void test_basic7(int in, int &out) {
-  if (in > 77) {
-    out++;
-    out++;
-  }
-  else
-    out++;
-
-  out++;
-}
-
-void test_basic8(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-    out++;
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-    out++;
-    out++;
-  }
-
-  if (in % 2)
-    out++;
-}
-
-void test_basic9(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    if (in % 2)
-      out++;
-    else
-      out--;
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-    if (in % 2)
-      out++;
-    else
-      out--;
-  }
-}
-
-// If we remove the braces from the previous example, the check recognizes it
-// as an `else if`.
-void test_basic10(int in, int &out) {
-  if (in > 77)
-    if (in % 2)
-      out++;
-    else
-      out--;
-  else
-    if (in % 2)
-      out++;
-    else
-      out--;
-
-}
-
-void test_basic11(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    if (in % 2)
-      out++;
-    else
-      out--;
-    if (in % 3)
-      out++;
-    else
-      out--;
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-    if (in % 2)
-      out++;
-    else
-      out--;
-    if (in % 3)
-      out++;
-    else
-      out--;
-  }
-}
-
-void test_basic12(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-  }
-}
-
-void test_basic13(int in, int &out) {
-  if (in > 77) {
-    // Empty compound statement is not identical to null statement.
-  } else;
-}
-
-// We use a comparison that ignores redundant parentheses:
-void test_basic14(int in, int &out) {
-  if (in > 77)
-    out += 2;
-  else
-    (out) += (2);
-}
-
-void test_basic15(int in, int &out) {
-  if (in > 77)
-    ((out += 2));
-  else
-    out += 2;
-}
-
-// ..but does not apply additional simplifications:
-void test_basic16(int in, int &out) {
-  if (in > 77)
-    out += 2;
-  else
-    out += 1 + 1;
-}
-
-// ..and does not forget important parentheses:
-int test_basic17(int a, int b, int c, int mode) {
-  if (mode>8)
-    return (a + b) * c;
-  else
-    return a + b * c;
-}
-
-//=========--------------------==========//
-
-#define PASTE_CODE(x) x
-
-void test_macro1(int in, int &out) {
-  PASTE_CODE(
-    if (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone]
-      out++;
-    else
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-      out++;
-  )
-
-  out--;
-}
-
-void test_macro2(int in, int &out) {
-  PASTE_CODE(
-    if (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone]
-      out++;
-  )
-  else
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    out++;
-}
-
-void test_macro3(int in, int &out) {
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  PASTE_CODE(
-    else
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-      out++;
-  )
-}
-
-void test_macro4(int in, int &out) {
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  else
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    PASTE_CODE(
-      out++;
-    )
-}
-
-void test_macro5(int in, int &out) {
-  PASTE_CODE(if) (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  PASTE_CODE(else)
-// CHECK-MESSAGES: :[[@LINE-1]]:14: note: else branch starts here
-    out++;
-}
-
-#define OTHERWISE_INCREASE else out++
-
-void test_macro6(int in, int &out) {
-  if (in > 77)
-      out++;
-// CHECK-MESSAGES: :[[@LINE-2]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-  OTHERWISE_INCREASE;
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-// CHECK-MESSAGES: :[[@LINE-8]]:28: note: expanded from macro 'OTHERWISE_INCREASE'
-}
-
-#define COND_INCR(a, b, c) \
-  do {                     \
-    if ((a))               \
-      (b)++;               \
-    else                   \
-      (c)++;               \
-  } while (0)
-
-void test_macro7(int in, int &out1, int &out2) {
-  COND_INCR(in, out1, out1);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE-9]]:5: note: expanded from macro 'COND_INCR'
-// CHECK-MESSAGES: :[[@LINE-3]]:3: note: else branch starts here
-// CHECK-MESSAGES: :[[@LINE-9]]:5: note: expanded from macro 'COND_INCR'
-}
-
-void test_macro8(int in, int &out1, int &out2) {
-  COND_INCR(in, out1, out2);
-}
-
-void test_macro9(int in, int &out1, int &out2) {
-  COND_INCR(in, out2, out2);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE-21]]:5: note: expanded from macro 'COND_INCR'
-// CHECK-MESSAGES: :[[@LINE-3]]:3: note: else branch starts here
-// CHECK-MESSAGES: :[[@LINE-21]]:5: note: expanded from macro 'COND_INCR'
-}
-
-#define CONCAT(a, b) a##b
-
-void test_macro10(int in, int &out) {
-  CONCAT(i, f) (in > 77)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    out++;
-  CONCAT(el, se)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    out++;
-}
-
-#define PROBLEM (-1)
-
-int test_macro11(int count) {
-  if (!count)
-    return PROBLEM;
-  else if (count == 13)
-    return -1;
-  else
-    return count * 2;
-}
-
-#define IF if (
-#define THEN ) {
-#define ELSE } else {
-#define END }
-
-void test_macro12(int in, int &out) {
-  IF in > 77 THEN
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE-8]]:12: note: expanded from macro 'IF'
-    out++;
-    out++;
-  ELSE
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-// CHECK-MESSAGES: :[[@LINE-11]]:16: note: expanded from macro 'ELSE'
-    out++;
-    out++;
-  END
-}
-
-// A hack for implementing a switch with no fallthrough:
-#define SWITCH(x) switch (x) {
-#define CASE(x) break; case (x):
-#define DEFAULT break; default:
-
-void test_macro13(int in, int &out) {
-  SWITCH(in)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-    CASE(1)
-      out++;
-      out++;
-    CASE(2)
-      out++;
-      out++;
-    CASE(3)
-      out++;
-      out++;
-// CHECK-MESSAGES: :[[@LINE-15]]:24: note: expanded from macro 'CASE'
-// CHECK-MESSAGES: :[[@LINE+1]]:9: note: last of these clones ends here
-    CASE(4)
-      out++;
-    CASE(5)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-    CASE(6)
-      out--;
-    CASE(7)
-      out--;
-// CHECK-MESSAGES: :[[@LINE-25]]:24: note: expanded from macro 'CASE'
-// CHECK-MESSAGES: :[[@LINE+2]]:9: note: last of these clones ends here
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-    CASE(8)
-      out++;
-      out++;
-    CASE(9)
-      out++;
-      out++;
-// CHECK-MESSAGES: :[[@LINE-34]]:24: note: expanded from macro 'CASE'
-// CHECK-MESSAGES: :[[@LINE+2]]:12: note: last of these clones ends here
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-    DEFAULT
-      out--;
-      out--;
-    CASE(10)
-      out--;
-      out--;
-// CHECK-MESSAGES: :[[@LINE-42]]:24: note: expanded from macro 'DEFAULT'
-// CHECK-MESSAGES: :[[@LINE+1]]:9: note: last of these clones ends here
-    CASE(12)
-      out++;
-    CASE(13)
-      out++;
-  END
-}
-
-//=========--------------------==========//
-
-void test_chain1(int in, int &out) {
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
-  else if (in > 55)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
-    out++;
-
-  out++;
-}
-
-void test_chain2(int in, int &out) {
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
-  else if (in > 55)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
-    out++;
-  else if (in > 42)
-    out--;
-  else if (in > 28)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 2 starts here
-    out++;
-  else if (in > 12) {
-    out++;
-    out *= 7;
-  } else if (in > 7) {
-// CHECK-MESSAGES: :[[@LINE-1]]:22: note: clone 3 starts here
-    out++;
-  }
-}
-
-void test_chain3(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-    out++;
-// CHECK-MESSAGES: :[[@LINE+1]]:4: note: end of the original
-  } else if (in > 55) {
-// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
-    out++;
-    out++;
-  } else if (in > 42)
-    out--;
-  else if (in > 28) {
-// CHECK-MESSAGES: :[[@LINE-1]]:21: note: clone 2 starts here
-    out++;
-    out++;
-  } else if (in > 12) {
-    out++;
-    out++;
-    out++;
-    out *= 7;
-  } else if (in > 7) {
-// CHECK-MESSAGES: :[[@LINE-1]]:22: note: clone 3 starts here
-    out++;
-    out++;
-  }
-}
-
-// In this chain there are two clone families; notice that the checker
-// describes all branches of the first one before mentioning the second one.
-void test_chain4(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-    out++;
-// CHECK-MESSAGES: :[[@LINE+1]]:4: note: end of the original
-  } else if (in > 55) {
-// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
-// CHECK-MESSAGES: :[[@LINE+8]]:21: note: clone 2 starts here
-// CHECK-MESSAGES: :[[@LINE+15]]:22: note: clone 3 starts here
-    out++;
-    out++;
-  } else if (in > 42)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out--;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
-  else if (in > 28) {
-    out++;
-    out++;
-  } else if (in > 12) {
-    out++;
-    out++;
-    out++;
-    out *= 7;
-  } else if (in > 7) {
-    out++;
-    out++;
-  } else if (in > -3) {
-// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
-    out--;
-  }
-}
-
-void test_chain5(int in, int &out) {
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
-  else if (in > 55)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
-    out++;
-  else if (in > 42)
-    out--;
-  else if (in > 28)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 2 starts here
-    out++;
-  else if (in > 12) {
-    out++;
-    out *= 7;
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: clone 3 starts here
-    out++;
-  }
-}
-
-void test_chain6(int in, int &out) {
-  if (in > 77) {
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-    out++;
-// CHECK-MESSAGES: :[[@LINE+1]]:4: note: end of the original
-  } else if (in > 55) {
-// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
-    out++;
-    out++;
-  } else if (in > 42)
-    out--;
-  else if (in > 28) {
-// CHECK-MESSAGES: :[[@LINE-1]]:21: note: clone 2 starts here
-    out++;
-    out++;
-  } else if (in > 12) {
-    out++;
-    out++;
-    out++;
-    out *= 7;
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: clone 3 starts here
-    out++;
-    out++;
-  }
-}
-
-void test_nested(int a, int b, int c, int &out) {
-  if (a > 5) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+27]]:5: note: else branch starts here
-    if (b > 5) {
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+9]]:6: note: end of the original
-// CHECK-MESSAGES: :[[@LINE+8]]:24: note: clone 1 starts here
-// CHECK-MESSAGES: :[[@LINE+14]]:12: note: clone 2 starts here
-      if (c > 5)
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
-        out++;
-      else
-// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
-        out++;
-    } else if (b > 15) {
-      if (c > 5)
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
-        out++;
-      else
-// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
-        out++;
-    } else {
-      if (c > 5)
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
-        out++;
-      else
-// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
-        out++;
-    }
-  } else {
-    if (b > 5) {
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+9]]:6: note: end of the original
-// CHECK-MESSAGES: :[[@LINE+8]]:24: note: clone 1 starts here
-// CHECK-MESSAGES: :[[@LINE+14]]:12: note: clone 2 starts here
-      if (c > 5)
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
-        out++;
-      else
-// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
-        out++;
-    } else if (b > 15) {
-      if (c > 5)
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
-        out++;
-      else
-// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
-        out++;
-    } else {
-      if (c > 5)
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
-        out++;
-      else
-// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
-        out++;
-    }
-  }
-}
-
-//=========--------------------==========//
-
-template <class T>
-void test_template_not_instantiated(const T &t) {
-  int a;
-  if (t)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    a++;
-  else
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    a++;
-}
-
-template <class T>
-void test_template_instantiated(const T &t) {
-  int a;
-  if (t)
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    a++;
-  else
-// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
-    a++;
-}
-
-template void test_template_instantiated<int>(const int &t);
-
-template <class T>
-void test_template2(T t, int a) {
-  if (a) {
-    T b(0);
-    a += b;
-  } else {
-    int b(0);
-    a += b;
-  }
-}
-
-template void test_template2<int>(int t, int a);
-
-template <class T>
-void test_template3(T t, int a) {
-  if (a) {
-    T b(0);
-    a += b;
-  } else {
-    int b(0);
-    a += b;
-  }
-}
-
-template void test_template3<short>(short t, int a);
-
-template <class T>
-void test_template_two_instances(T t, int &a) {
-  if (a) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    a += int(t);
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-    a += int(t);
-  }
-}
-
-template void test_template_two_instances<short>(short t, int &a);
-template void test_template_two_instances<long>(long t, int &a);
-
-class C {
-  int member;
-  void inline_method(int arg) {
-    if (arg)
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone]
-      member = 3;
-    else
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-      member = 3;
-  }
-  int other_method();
-};
-
-int C::other_method() {
-  if (member) {
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
-    return 8;
-  } else {
-// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
-    return 8;
-  }
-}
-
-//=========--------------------==========//
-
-int simple_switch(char ch) {
-  switch (ch) {
-// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-  case 'a':
-    return 10;
-  case 'A':
-    return 10;
-// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
-// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-  case 'b':
-    return 11;
-  case 'B':
-    return 11;
-// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
-// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-  case 'c':
-    return 10;
-  case 'C':
-    return 10;
-// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
-  default:
-    return 0;
-  }
-}
-
-int long_sequence_switch(char ch) {
-  switch (ch) {
-// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 7 consecutive identical branches [bugprone-branch-clone]
-  case 'a':
-    return 10;
-  case 'A':
-    return 10;
-  case 'b':
-    return 10;
-  case 'B':
-    return 10;
-  case 'c':
-    return 10;
-  case 'C':
-    return 10;
-  default:
-    return 10;
-// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
-  }
-}
-
-int nested_switch(int a, int b, int c) {
-  switch (a) {
-// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+114]]:6: note: last of these clones ends here
-  case 1:
-    switch (b) {
-// CHECK-MESSAGES: :[[@LINE+2]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+33]]:8: note: last of these clones ends here
-    case 1:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    case 2:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    default:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    }
-  case 2:
-    switch (b) {
-// CHECK-MESSAGES: :[[@LINE+2]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+33]]:8: note: last of these clones ends here
-    case 1:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    case 2:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    default:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    }
-  default:
-    switch (b) {
-// CHECK-MESSAGES: :[[@LINE+2]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-// CHECK-MESSAGES: :[[@LINE+33]]:8: note: last of these clones ends here
-    case 1:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    case 2:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    default:
-      switch (c) {
-// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
-      case 1:
-        return 42;
-      case 2:
-        return 42;
-      default:
-        return 42;
-// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
-      }
-    }
-  }
-}
-
-//=========--------------------==========//
-
-// This should not produce warnings, as in switch statements we only report
-// identical branches when they are consecutive. Also note that a branch
-// terminated by a break is different from a branch terminated by the end of
-// the switch statement.
-int interleaved_cases(int a, int b) {
-  switch (a) {
-  case 3:
-  case 4:
-    b = 2;
-    break;
-  case 5:
-    b = 3;
-    break;
-  case 6:
-    b = 2;
-    break;
-  case 7:
-    if (b % 2) {
-      b++;
-    } else {
-      b++;
-      break;
-    }
-    b = 2;
-    break;
-  case 8:
-    b = 2;
-  case 9:
-    b = 3;
-    break;
-  default:
-    b = 3;
-  }
-  return b;
-}
-
-
-// A case: or default: is only considered to be the start of a branch if it is a direct child of the CompoundStmt forming the body of the switch
-int buried_cases(int foo) {
-  switch (foo) {
-    {
-    case 36:
-      return 8;
-    default:
-      return 8;
-    }
-  }
-}
-
-// Here the `case 7:` is a child statement of the GotoLabelStmt, so the checker
-// thinks that it is part of the `case 9:` branch. While this result is
-// counterintuitve, mixing goto labels and switch statements in this fashion is
-// pretty rare, so it does not deserve a special case in the checker code.
-int decorated_cases(int z) {
-  if (!(z % 777)) {
-    goto lucky;
-  }
-  switch (z) {
-// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-  case 1:
-  case 2:
-  case 3:
-    z++;
-    break;
-  case 4:
-  case 5:
-    z++;
-    break;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: last of these clones ends here
-  case 9:
-    z++;
-    break;
-  lucky:
-  case 7:
-    z += 3;
-    z *= 2;
-    break;
-  case 92:
-    z += 3;
-    z *= 2;
-    break;
-  default:
-    z++;
-  }
-  return z + 92;
-}
-
-// The child of the switch statement is not neccessarily a compound statement,
-// do not crash in this unusual case.
-char no_real_body(int in, int &out) {
-  switch (in)
-  case 42:
-    return 'A';
-
-  if (in > 77)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
-    out++;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
-  else if (in > 55)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
-    out++;
-  else if (in > 34)
-// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 2 starts here
-    out++;
-
-  return '|';
-}
-
-// Duff's device [https://en.wikipedia.org/wiki/Duff's_device]
-// The check does not try to distinguish branches in this sort of convoluted
-// code, but it should avoid crashing.
-void send(short *to, short *from, int count)
-{
-    int n = (count + 7) / 8;
-    switch (count % 8) {
-    case 0: do { *to = *from++;
-    case 7:      *to = *from++;
-    case 6:      *to = *from++;
-    case 5:      *to = *from++;
-    case 4:      *to = *from++;
-    case 3:      *to = *from++;
-    case 2:      *to = *from++;
-    case 1:      *to = *from++;
-            } while (--n > 0);
-    }
-}
-
-//=========--------------------==========//
-
-void ternary1(bool b, int &x) {
-// CHECK-MESSAGES: :[[@LINE+1]]:6: warning: conditional operator with identical true and false expressions [bugprone-branch-clone]
-  (b ? x : x) = 42;
-}
-
-int ternary2(bool b, int x) {
-// CHECK-MESSAGES: :[[@LINE+1]]:12: warning: conditional operator with identical true and false expressions [bugprone-branch-clone]
-  return b ? 42 : 42;
-}
-
-int ternary3(bool b, int x) {
-  return b ? 42 : 43;
-}
-
-int ternary4(bool b, int x) {
-  return b ? true ? 45 : 44 : false ? 45 : 44;
-}
-
-// We do not detect chains of conditional operators.
-int ternary5(bool b1, bool b2, int x) {
-  return b1 ? 42 : b2 ? 43 : 42;
-}
-
-#define SWITCH_WITH_LBRACE(b) switch (b) {
-#define SEMICOLON_CASE_COLON(b)                                                \
-  ;                                                                            \
-  case b:
-int d, e;
-void dontCrash() {
-  SWITCH_WITH_LBRACE(d)
-// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
-  SEMICOLON_CASE_COLON(1)
-    e++;
-    e++;
-  SEMICOLON_CASE_COLON(2)
-    e++;
-    e++;
-  // CHECK-MESSAGES: :[[@LINE-11]]:3: note: expanded from macro 'SEMICOLON_CASE_COLON'
-  // CHECK-MESSAGES: :[[@LINE+1]]:23: note: last of these clones ends here
-  SEMICOLON_CASE_COLON(3);
-  }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-copy-constructor-init.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-copy-constructor-init.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-copy-constructor-init.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-copy-constructor-init.cpp (removed)
@@ -1,188 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-copy-constructor-init %t
-
-class NonCopyable {
-public:
-  NonCopyable() = default;
-  NonCopyable(const NonCopyable &) = delete;
-
-private:
-  int a;
-};
-
-class NonCopyable2 {
-public:
-  NonCopyable2() = default;
-
-private:
-  NonCopyable2(const NonCopyable2 &);
-  int a;
-};
-
-class Copyable {
-public:
-  Copyable() = default;
-  Copyable(const Copyable &) = default;
-
-private:
-  int a;
-};
-
-class Copyable2 {
-public:
-  Copyable2() = default;
-  Copyable2(const Copyable2 &) = default;
-
-private:
-  int a;
-};
-
-class Copyable3 : public Copyable {
-public:
-  Copyable3() = default;
-  Copyable3(const Copyable3 &) = default;
-};
-
-template <class C>
-class Copyable4 {
-public:
-  Copyable4() = default;
-  Copyable4(const Copyable4 &) = default;
-
-private:
-  int a;
-};
-
-template <class T, class S>
-class Copyable5 {
-public:
-  Copyable5() = default;
-  Copyable5(const Copyable5 &) = default;
-
-private:
-  int a;
-};
-
-class EmptyCopyable {
-public:
-  EmptyCopyable() = default;
-  EmptyCopyable(const EmptyCopyable &) = default;
-};
-
-template <typename T>
-using CopyableAlias = Copyable5<T, int>;
-
-typedef Copyable5<int, int> CopyableAlias2;
-
-class X : public Copyable, public EmptyCopyable {
-  X(const X &other) : Copyable(other) {}
-};
-
-class X2 : public Copyable2 {
-  X2(const X2 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor other than the copy constructor [bugprone-copy-constructor-init]
-  // CHECK-FIXES: X2(const X2 &other)  : Copyable2(other) {}
-};
-
-class X2_A : public Copyable2 {
-  X2_A(const X2_A &) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X2_A(const X2_A &) {}
-};
-
-class X3 : public Copyable, public Copyable2 {
-  X3(const X3 &other) : Copyable(other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X3(const X3 &other) : Copyable(other) {}
-};
-
-class X4 : public Copyable {
-  X4(const X4 &other) : Copyable() {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X4(const X4 &other) : Copyable(other) {}
-};
-
-class X5 : public Copyable3 {
-  X5(const X5 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X5(const X5 &other)  : Copyable3(other) {}
-};
-
-class X6 : public Copyable2, public Copyable3 {
-  X6(const X6 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X6(const X6 &other)  : Copyable2(other), Copyable3(other) {}
-};
-
-class X7 : public Copyable, public Copyable2 {
-  X7(const X7 &other) : Copyable() {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X7(const X7 &other) : Copyable(other) {}
-};
-
-class X8 : public Copyable4<int> {
-  X8(const X8 &other) : Copyable4(other) {}
-};
-
-class X9 : public Copyable4<int> {
-  X9(const X9 &other) : Copyable4() {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X9(const X9 &other) : Copyable4(other) {}
-};
-
-class X10 : public Copyable4<int> {
-  X10(const X10 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X10(const X10 &other)  : Copyable4(other) {}
-};
-
-class X11 : public Copyable5<int, float> {
-  X11(const X11 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X11(const X11 &other)  : Copyable5(other) {}
-};
-
-class X12 : public CopyableAlias<float> {
-  X12(const X12 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X12(const X12 &other) {}
-};
-
-template <typename T>
-class X13 : T {
-  X13(const X13 &other) {}
-};
-
-template class X13<EmptyCopyable>;
-template class X13<Copyable>;
-
-#define FROMMACRO                \
-  class X14 : public Copyable2 { \
-    X14(const X14 &other) {}     \
-  };
-
-FROMMACRO
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: calling a base constructor
-
-class X15 : public CopyableAlias2 {
-  X15(const X15 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X15(const X15 &other) {}
-};
-
-class X16 : public NonCopyable {
-  X16(const X16 &other) {}
-};
-
-class X17 : public NonCopyable2 {
-  X17(const X17 &other) {}
-};
-
-class X18 : private Copyable {
-  X18(const X18 &other) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
-  // CHECK-FIXES: X18(const X18 &other)  : Copyable(other) {}
-};
-
-class X19 : private Copyable {
-  X19(const X19 &other) : Copyable(other) {}
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-dangling-handle.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-dangling-handle.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-dangling-handle.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-dangling-handle.cpp (removed)
@@ -1,195 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-dangling-handle %t -- \
-// RUN:   -config="{CheckOptions: \
-// RUN:             [{key: bugprone-dangling-handle.HandleClasses, \
-// RUN:               value: 'std::basic_string_view; ::llvm::StringRef;'}]}"
-// FIXME: Fix the checker to work in C++17 mode.
-
-namespace std {
-
-template <typename T>
-class vector {
- public:
-  using const_iterator = const T*;
-  using iterator = T*;
-  using size_type = int;
-
-  void assign(size_type count, const T& value);
-  iterator insert(const_iterator pos, const T& value);
-  iterator insert(const_iterator pos, T&& value);
-  iterator insert(const_iterator pos, size_type count, const T& value);
-  void push_back(const T&);
-  void push_back(T&&);
-  void resize(size_type count, const T& value);
-};
-
-template <typename, typename>
-class pair {};
-
-template <typename T>
-class set {
- public:
-  using const_iterator = const T*;
-  using iterator = T*;
-
-  std::pair<iterator, bool> insert(const T& value);
-  std::pair<iterator, bool> insert(T&& value);
-  iterator insert(const_iterator hint, const T& value);
-  iterator insert(const_iterator hint, T&& value);
-};
-
-template <typename Key, typename Value>
-class map {
- public:
-  using value_type = pair<Key, Value>;
-  value_type& operator[](const Key& key);
-  value_type& operator[](Key&& key);
-};
-
-class basic_string_view;
-
-class basic_string {
- public:
-  basic_string();
-  basic_string(const char*);
-
-  operator basic_string_view() const noexcept;
-
-  ~basic_string();
-};
-
-typedef basic_string string;
-
-class basic_string_view {
- public:
-  basic_string_view(const char*);
-};
-
-typedef basic_string_view string_view;
-
-}  // namespace std
-
-namespace llvm {
-
-class StringRef {
- public:
-  StringRef();
-  StringRef(const char*);
-  StringRef(const std::string&);
-};
-
-}  // namespace llvm
-
-std::string ReturnsAString();
-
-void Positives() {
-  std::string_view view1 = std::string();
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives its value [bugprone-dangling-handle]
-
-  std::string_view view_2 = ReturnsAString();
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives
-
-  view1 = std::string();
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-
-  const std::string& str_ref = "";
-  std::string_view view3 = true ? "A" : str_ref;
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives
-  view3 = true ? "A" : str_ref;
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-
-  std::string_view view4(ReturnsAString());
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives
-}
-
-void OtherTypes() {
-  llvm::StringRef ref = std::string();
-  // CHECK-MESSAGES: [[@LINE-1]]:19: warning: llvm::StringRef outlives its value
-}
-
-const char static_array[] = "A";
-std::string_view ReturnStatements(int i, std::string value_arg,
-                                  const std::string &ref_arg) {
-  const char array[] = "A";
-  const char* ptr = "A";
-  std::string s;
-  static std::string ss;
-  switch (i) {
-    // Bad cases
-    case 0:
-      return array;  // refers to local
-      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
-    case 1:
-      return s;  // refers to local
-      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
-    case 2:
-      return std::string();  // refers to temporary
-      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
-    case 3:
-      return value_arg;  // refers to by-value arg
-      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
-
-    // Ok cases
-    case 100:
-      return ss;  // refers to static
-    case 101:
-      return static_array;  // refers to static
-    case 102:
-      return ptr;  // pointer is ok
-    case 103:
-      return ref_arg;  // refers to by-ref arg
-  }
-
-  struct S {
-    std::string_view view() { return value; }
-    std::string value;
-  };
-
-  (void)[&]()->std::string_view {
-    // This should not warn. The string is bound by reference.
-    return s;
-  };
-  (void)[=]() -> std::string_view {
-    // This should not warn. The reference is valid as long as the lambda.
-    return s;
-  };
-  (void)[=]() -> std::string_view {
-    // FIXME: This one should warn. We are returning a reference to a local
-    // lambda variable.
-    std::string local;
-    return local;
-  };
-  return "";
-}
-
-void Containers() {
-  std::vector<std::string_view> v;
-  v.assign(3, std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-  v.insert(nullptr, std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-  v.insert(nullptr, 3, std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-  v.push_back(std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-  v.resize(3, std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-
-  std::set<std::string_view> s;
-  s.insert(std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-  s.insert(nullptr, std::string());
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-
-  std::map<std::string_view, int> m;
-  m[std::string()];
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
-}
-
-void TakesAStringView(std::string_view);
-
-void Negatives(std::string_view default_arg = ReturnsAString()) {
-  std::string str;
-  std::string_view view = str;
-
-  TakesAStringView(std::string());
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-dynamic-static-initializers.hpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-dynamic-static-initializers.hpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-dynamic-static-initializers.hpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-dynamic-static-initializers.hpp (removed)
@@ -1,44 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-dynamic-static-initializers %t -- -- -fno-threadsafe-statics
-
-int fact(int n) {
-  return (n == 0) ? 1 : n * fact(n - 1);
-}
-
-int static_thing = fact(5);
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: static variable 'static_thing' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
-
-int sample() {
-    int x;
-    return x;
-}
-
-int dynamic_thing = sample();
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: static variable 'dynamic_thing' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
-
-int not_so_bad = 12 + 4942; // no warning
-
-extern int bar();
-
-int foo() {
-  static int k = bar();
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: static variable 'k' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
-  return k;
-}
-
-int bar2() {
-  return 7;
-}
-
-int foo2() {
-  // This may work fine when optimization is enabled because bar() can
-  // be turned into a constant 7.  But without optimization, it can
-  // cause problems. Therefore, we must err on the side of conservatism.
-  static int x = bar2();
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: static variable 'x' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
-  return x;
-}
-
-int foo3() {
-  static int p = 7 + 83; // no warning
-  return p;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape-openmp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape-openmp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape-openmp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape-openmp.cpp (removed)
@@ -1,29 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-exception-escape %t -- -extra-arg=-fopenmp=libomp -extra-arg=-fexceptions --
-
-int thrower() {
-  throw 42;
-}
-
-void ok_parallel() {
-#pragma omp parallel
-  thrower();
-}
-
-void bad_for_header_XFAIL(const int a) noexcept {
-#pragma omp for
-  for (int i = 0; i < thrower(); i++)
-    ;
-  // FIXME: this really should be caught by bugprone-exception-escape.
-  // https://bugs.llvm.org/show_bug.cgi?id=41102
-}
-
-void ok_forloop(const int a) {
-#pragma omp for
-  for (int i = 0; i < a; i++)
-    thrower();
-}
-
-void some_exception_just_so_that_check_clang_tidy_shuts_up() noexcept {
-  thrower();
-}
-// CHECK-MESSAGES: :[[@LINE-3]]:6: warning: an exception may be thrown in function 'some_exception_just_so_that_check_clang_tidy_shuts_up' which should not throw exceptions

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-exception-escape.cpp (removed)
@@ -1,295 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-exception-escape %t -- \
-// RUN:     -config="{CheckOptions: [ \
-// RUN:         {key: bugprone-exception-escape.IgnoredExceptions, value: 'ignored1,ignored2'}, \
-// RUN:         {key: bugprone-exception-escape.FunctionsThatShouldNotThrow, value: 'enabled1,enabled2,enabled3'} \
-// RUN:     ]}" \
-// RUN:     -- -fexceptions
-
-struct throwing_destructor {
-  ~throwing_destructor() {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: an exception may be thrown in function '~throwing_destructor' which should not throw exceptions
-    throw 1;
-  }
-};
-
-struct throwing_move_constructor {
-  throwing_move_constructor(throwing_move_constructor&&) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: an exception may be thrown in function 'throwing_move_constructor' which should not throw exceptions
-    throw 1;
-  }
-};
-
-struct throwing_move_assignment {
-  throwing_move_assignment& operator=(throwing_move_assignment&&) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: an exception may be thrown in function 'operator=' which should not throw exceptions
-    throw 1;
-  }
-};
-
-void throwing_noexcept() noexcept {
-    // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throwing_noexcept' which should not throw exceptions
-  throw 1;
-}
-
-void throwing_throw_nothing() throw() {
-    // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throwing_throw_nothing' which should not throw exceptions
-  throw 1;
-}
-
-void throw_and_catch() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch' which should not throw exceptions
-  try {
-    throw 1;
-  } catch(int &) {
-  }
-}
-
-void throw_and_catch_some(int n) noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch_some' which should not throw exceptions
-  try {
-    if (n) throw 1;
-    throw 1.1;
-  } catch(int &) {
-  }
-}
-
-void throw_and_catch_each(int n) noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch_each' which should not throw exceptions
-  try {
-    if (n) throw 1;
-    throw 1.1;
-  } catch(int &) {
-  } catch(double &) {
-  }
-}
-
-void throw_and_catch_all(int n) noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch_all' which should not throw exceptions
-  try {
-    if (n) throw 1;
-    throw 1.1;
-  } catch(...) {
-  }
-}
-
-void throw_and_rethrow() noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_rethrow' which should not throw exceptions
-  try {
-    throw 1;
-  } catch(int &) {
-    throw;
-  }
-}
-
-void throw_catch_throw() noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_catch_throw' which should not throw exceptions
-  try {
-    throw 1;
-  } catch(int &) {
-    throw 2;
-  }
-}
-
-void throw_catch_rethrow_the_rest(int n) noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_catch_rethrow_the_rest' which should not throw exceptions
-  try {
-    if (n) throw 1;
-    throw 1.1;
-  } catch(int &) {
-  } catch(...) {
-    throw;
-  }
-}
-
-class base {};
-class derived: public base {};
-
-void throw_derived_catch_base() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_derived_catch_base' which should not throw exceptions
-  try {
-    throw derived();
-  } catch(base &) {
-  }
-}
-
-void try_nested_try(int n) noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'try_nested_try' which should not throw exceptions
-  try {
-    try {
-      if (n) throw 1;
-      throw 1.1;
-    } catch(int &) {
-    }
-  } catch(double &) {
-  }
-}
-
-void bad_try_nested_try(int n) noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'bad_try_nested_try' which should not throw exceptions
-  try {
-    if (n) throw 1;
-    try {
-      throw 1.1;
-    } catch(int &) {
-    }
-  } catch(double &) {
-  }
-}
-
-void try_nested_catch() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'try_nested_catch' which should not throw exceptions
-  try {
-    try {
-      throw 1;
-    } catch(int &) {
-      throw 1.1;
-    }
-  } catch(double &) {
-  }
-}
-
-void catch_nested_try() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'catch_nested_try' which should not throw exceptions
-  try {
-    throw 1;
-  } catch(int &) {
-    try {
-      throw 1;
-    } catch(int &) {
-    }
-  }
-}
-
-void bad_catch_nested_try() noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'bad_catch_nested_try' which should not throw exceptions
-  try {
-    throw 1;
-  } catch(int &) {
-    try {
-      throw 1.1;
-    } catch(int &) {
-    }
-  } catch(double &) {
-  }
-}
-
-void implicit_int_thrower() {
-  throw 1;
-}
-
-void explicit_int_thrower() throw(int);
-
-void indirect_implicit() noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'indirect_implicit' which should not throw exceptions
-  implicit_int_thrower();
-}
-
-void indirect_explicit() noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'indirect_explicit' which should not throw exceptions
-  explicit_int_thrower();
-}
-
-void indirect_catch() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'indirect_catch' which should not throw exceptions
-  try {
-    implicit_int_thrower();
-  } catch(int&) {
-  }
-}
-
-template<typename T>
-void dependent_throw() noexcept(sizeof(T)<4) {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'dependent_throw' which should not throw exceptions
-  if (sizeof(T) > 4)
-    throw 1;
-}
-
-void swap(int&, int&) {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'swap' which should not throw exceptions
-  throw 1;
-}
-
-namespace std {
-class bad_alloc {};
-}
-
-void alloc() {
-  throw std::bad_alloc();
-}
-
-void allocator() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'allocator' which should not throw exceptions
-  alloc();
-}
-
-void enabled1() {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'enabled1' which should not throw exceptions
-  throw 1;
-}
-
-void enabled2() {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'enabled2' which should not throw exceptions
-  enabled1();
-}
-
-void enabled3() {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'enabled3' which should not throw exceptions
-  try {
-    enabled1();
-  } catch(...) {
-  }
-}
-
-class ignored1 {};
-class ignored2 {};
-
-void this_does_not_count() noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'this_does_not_count' which should not throw exceptions
-  throw ignored1();
-}
-
-void this_does_not_count_either(int n) noexcept {
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'this_does_not_count_either' which should not throw exceptions
-  try {
-    throw 1;
-    if (n) throw ignored2();
-  } catch(int &) {
-  }
-}
-
-void this_counts(int n) noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'this_counts' which should not throw exceptions
-  if (n) throw 1;
-  throw ignored1();
-}
-
-void thrower(int n) {
-  throw n;
-}
-
-int directly_recursive(int n) noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'directly_recursive' which should not throw exceptions
-  if (n == 0)
-    thrower(n);
-  return directly_recursive(n);
-}
-
-int indirectly_recursive(int n) noexcept;
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'indirectly_recursive' which should not throw exceptions
-
-int recursion_helper(int n) {
-  indirectly_recursive(n);
-}
-
-int indirectly_recursive(int n) noexcept {
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'indirectly_recursive' which should not throw exceptions
-  if (n == 0)
-    thrower(n);
-  return recursion_helper(n);
-}
-
-int main() {
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'main' which should not throw exceptions
-  throw 1;
-  return 0;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-fold-init-type.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-fold-init-type.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-fold-init-type.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-fold-init-type.cpp (removed)
@@ -1,158 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-fold-init-type %t
-
-namespace std {
-template <class InputIt, class T>
-T accumulate(InputIt first, InputIt last, T init);
-
-template <class InputIt, class T>
-T reduce(InputIt first, InputIt last, T init);
-template <class ExecutionPolicy, class InputIt, class T>
-T reduce(ExecutionPolicy &&policy,
-         InputIt first, InputIt last, T init);
-
-struct parallel_execution_policy {};
-constexpr parallel_execution_policy par{};
-
-template <class InputIt1, class InputIt2, class T>
-T inner_product(InputIt1 first1, InputIt1 last1,
-                InputIt2 first2, T value);
-
-template <class ExecutionPolicy, class InputIt1, class InputIt2, class T>
-T inner_product(ExecutionPolicy &&policy, InputIt1 first1, InputIt1 last1,
-                InputIt2 first2, T value);
-
-} // namespace std
-
-struct FloatIterator {
-  typedef float value_type;
-};
-template <typename ValueType>
-struct TypedefTemplateIterator { typedef ValueType value_type; };
-template <typename ValueType>
-struct UsingTemplateIterator { using value_type = ValueType; };
-template <typename ValueType>
-struct DependentTypedefTemplateIterator { typedef typename ValueType::value_type value_type; };
-template <typename ValueType>
-struct DependentUsingTemplateIterator : public TypedefTemplateIterator<ValueType> { using typename TypedefTemplateIterator<ValueType>::value_type; };
-using TypedeffedIterator = FloatIterator;
-
-// Positives.
-
-int accumulatePositive1() {
-  float a[1] = {0.5f};
-  return std::accumulate(a, a + 1, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-int accumulatePositive2() {
-  FloatIterator it;
-  return std::accumulate(it, it, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-int accumulatePositive3() {
-  double a[1] = {0.0};
-  return std::accumulate(a, a + 1, 0.0f);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'double' into type 'float'
-}
-
-int accumulatePositive4() {
-  TypedefTemplateIterator<unsigned> it;
-  return std::accumulate(it, it, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'unsigned int' into type 'int'
-}
-
-int accumulatePositive5() {
-  UsingTemplateIterator<unsigned> it;
-  return std::accumulate(it, it, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'unsigned int' into type 'int'
-}
-
-int accumulatePositive6() {
-  DependentTypedefTemplateIterator<UsingTemplateIterator<unsigned>> it;
-  return std::accumulate(it, it, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'unsigned int' into type 'int'
-}
-
-int accumulatePositive7() {
-  TypedeffedIterator it;
-  return std::accumulate(it, it, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-int accumulatePositive8() {
-  DependentUsingTemplateIterator<unsigned> it;
-  return std::accumulate(it, it, 0);
-  // FIXME: this one should trigger too.
-}
-
-int reducePositive1() {
-  float a[1] = {0.5f};
-  return std::reduce(a, a + 1, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-int reducePositive2() {
-  float a[1] = {0.5f};
-  return std::reduce(std::par, a, a + 1, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-int innerProductPositive1() {
-  float a[1] = {0.5f};
-  int b[1] = {1};
-  return std::inner_product(std::par, a, a + 1, b, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-int innerProductPositive2() {
-  float a[1] = {0.5f};
-  int b[1] = {1};
-  return std::inner_product(std::par, a, a + 1, b, 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
-}
-
-// Negatives.
-
-int negative1() {
-  float a[1] = {0.5f};
-  // This is OK because types match.
-  return std::accumulate(a, a + 1, 0.0);
-}
-
-int negative2() {
-  float a[1] = {0.5f};
-  // This is OK because double is bigger than float.
-  return std::accumulate(a, a + 1, 0.0);
-}
-
-int negative3() {
-  float a[1] = {0.5f};
-  // This is OK because the user explicitly specified T.
-  return std::accumulate<float *, float>(a, a + 1, 0);
-}
-
-int negative4() {
-  TypedefTemplateIterator<unsigned> it;
-  // For now this is OK.
-  return std::accumulate(it, it, 0.0);
-}
-
-int negative5() {
-  float a[1] = {0.5f};
-  float b[1] = {1.0f};
-  return std::inner_product(std::par, a, a + 1, b, 0.0f);
-}
-
-namespace blah {
-namespace std {
-template <class InputIt, class T>
-T accumulate(InputIt, InputIt, T); // We should not care about this one.
-}
-
-int negative5() {
-  float a[1] = {0.5f};
-  // Note that this is using blah::std::accumulate.
-  return std::accumulate(a, a + 1, 0);
-}
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-forward-declaration-namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-forward-declaration-namespace.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-forward-declaration-namespace.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-forward-declaration-namespace.cpp (removed)
@@ -1,163 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-forward-declaration-namespace %t
-
-namespace {
-// This is a declaration in a wrong namespace.
-class T_A;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace 'na' [bugprone-forward-declaration-namespace]
-// CHECK-NOTES: note: a declaration of 'T_A' is found here
-// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)' [bugprone-forward-declaration-namespace]
-// CHECK-NOTES: note: a definition of 'T_A' is found here
-}
-
-namespace na {
-// This is a declaration in a wrong namespace.
-class T_A;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace '(anonymous)'
-// CHECK-NOTES: note: a declaration of 'T_A' is found here
-// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)'
-// CHECK-NOTES: note: a definition of 'T_A' is found here
-}
-
-class T_A;
-
-class T_A {
-  int x;
-};
-
-class NESTED;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: no definition found for 'NESTED', but a definition with the same name 'NESTED' found in another namespace '(anonymous namespace)::nq::(anonymous)'
-// CHECK-NOTES: note: a definition of 'NESTED' is found here
-
-namespace {
-namespace nq {
-namespace {
-class NESTED {};
-}
-}
-}
-
-namespace na {
-class T_B;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb'
-// CHECK-NOTES: note: a declaration of 'T_B' is found here
-// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb'
-// CHECK-NOTES: note: a definition of 'T_B' is found here
-}
-
-namespace nb {
-class T_B;
-}
-
-namespace nb {
-class T_B {
-  int x;
-};
-}
-
-namespace na {
-class T_B;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb'
-// CHECK-NOTES: note: a declaration of 'T_B' is found here
-// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb'
-// CHECK-NOTES: note: a definition of 'T_B' is found here
-}
-
-// A simple forward declaration. Although it is never used, but no declaration
-// with the same name is found in other namespace.
-class OUTSIDER;
-
-namespace na {
-// This class is referenced declaration, we don't generate warning.
-class OUTSIDER_1;
-}
-
-void f(na::OUTSIDER_1);
-
-namespace nc {
-// This class is referenced as friend in OOP.
-class OUTSIDER_1;
-
-class OOP {
-  friend struct OUTSIDER_1;
-};
-}
-
-namespace nd {
-class OUTSIDER_1;
-void f(OUTSIDER_1 *);
-}
-
-namespace nb {
-class OUTSIDER_1;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'OUTSIDER_1' is never referenced, but a declaration with the same name found in another namespace 'na'
-// CHECK-NOTES: note: a declaration of 'OUTSIDER_1' is found here
-}
-
-
-namespace na {
-template<typename T>
-class T_C;
-}
-
-namespace nb {
-// FIXME: this is an error, but we don't consider template class declaration
-// now.
-template<typename T>
-class T_C;
-}
-
-namespace na {
-template<typename T>
-class T_C {
-  int x;
-};
-}
-
-namespace na {
-
-template <typename T>
-class T_TEMP {
-  template <typename _Tp1>
-  struct rebind { typedef T_TEMP<_Tp1> other; };
-};
-
-// We ignore class template specialization.
-template class T_TEMP<char>;
-}
-
-namespace nb {
-
-template <typename T>
-class T_TEMP_1 {
-  template <typename _Tp1>
-  struct rebind { typedef T_TEMP_1<_Tp1> other; };
-};
-
-// We ignore class template specialization.
-extern template class T_TEMP_1<char>;
-}
-
-namespace nd {
-class D;
-// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'D' is never referenced, but a declaration with the same name found in another namespace 'nd::ne'
-// CHECK-NOTES: note: a declaration of 'D' is found here
-}
-
-namespace nd {
-namespace ne {
-class D;
-}
-}
-
-int f(nd::ne::D &d);
-
-
-// This should be ignored by the check.
-template <typename... Args>
-class Observer {
-  class Impl;
-};
-
-template <typename... Args>
-class Observer<Args...>::Impl {
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-forwarding-reference-overload.cpp (removed)
@@ -1,152 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-forwarding-reference-overload %t
-
-namespace std {
-template <bool B, class T = void> struct enable_if { typedef T type; };
-
-template <class T> struct enable_if<true, T> { typedef T type; };
-
-template <bool B, class T = void>
-using enable_if_t = typename enable_if<B, T>::type;
-
-template <class T> struct enable_if_nice { typedef T type; };
-} // namespace std
-
-namespace foo {
-template <class T> struct enable_if { typedef T type; };
-} // namespace foo
-
-template <typename T> constexpr bool just_true = true;
-
-class Test1 {
-public:
-  template <typename T> Test1(T &&n);
-  // CHECK-NOTES: [[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
-  // CHECK-NOTES: 48:3: note: copy constructor declared here
-  // CHECK-NOTES: 49:3: note: copy constructor declared here
-  // CHECK-NOTES: 50:3: note: move constructor declared here
-
-  template <typename T> Test1(T &&n, int i = 5, ...);
-  // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
-  // CHECK-NOTES: 48:3: note: copy constructor declared here
-  // CHECK-NOTES: 49:3: note: copy constructor declared here
-  // CHECK-NOTES: 50:3: note: move constructor declared here
-
-  template <typename T, typename U = typename std::enable_if_nice<T>::type>
-  Test1(T &&n);
-  // CHECK-NOTES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
-  // CHECK-NOTES: 48:3: note: copy constructor declared here
-  // CHECK-NOTES: 49:3: note: copy constructor declared here
-  // CHECK-NOTES: 50:3: note: move constructor declared here
-
-  template <typename T>
-  Test1(T &&n, typename foo::enable_if<long>::type i = 5, ...);
-  // CHECK-NOTES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
-  // CHECK-NOTES: 48:3: note: copy constructor declared here
-  // CHECK-NOTES: 49:3: note: copy constructor declared here
-  // CHECK-NOTES: 50:3: note: move constructor declared here
-
-  Test1(const Test1 &other) {}
-  Test1(Test1 &other) {}
-  Test1(Test1 &&other) {}
-};
-
-template <typename U> class Test2 {
-public:
-  // Two parameters without default value, can't act as copy / move constructor.
-  template <typename T, class V> Test2(T &&n, V &&m, int i = 5, ...);
-
-  // Guarded with enable_if.
-  template <typename T>
-  Test2(T &&n, int i = 5,
-        std::enable_if_t<sizeof(int) < sizeof(long), int> a = 5, ...);
-
-  // Guarded with enable_if.
-  template <typename T, typename X = typename std::enable_if<
-                            sizeof(int) < sizeof(long), double>::type &>
-  Test2(T &&n);
-
-  // Guarded with enable_if.
-  template <typename T>
-  Test2(T &&n, typename std::enable_if<just_true<T>>::type **a = nullptr);
-
-  // Guarded with enable_if.
-  template <typename T, typename X = std::enable_if_t<just_true<T>> *&&>
-  Test2(T &&n, double d = 0.0);
-
-  // Not a forwarding reference parameter.
-  template <typename T> Test2(const T &&n);
-
-  // Not a forwarding reference parameter.
-  Test2(int &&x);
-
-  // Two parameters without default value, can't act as copy / move constructor.
-  template <typename T> Test2(T &&n, int x);
-
-  // Not a forwarding reference parameter.
-  template <typename T> Test2(U &&n);
-};
-
-// The copy and move constructors are both disabled.
-class Test3 {
-public:
-  template <typename T> Test3(T &&n);
-
-  template <typename T> Test3(T &&n, int I = 5, ...);
-
-  Test3(const Test3 &rhs) = delete;
-
-private:
-  Test3(Test3 &&rhs);
-};
-
-// Both the copy and the (compiler generated) move constructors can be hidden.
-class Test4 {
-public:
-  template <typename T> Test4(T &&n);
-  // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
-
-  Test4(const Test4 &rhs);
-  // CHECK-NOTES: :[[@LINE-1]]:3: note: copy constructor declared here
-};
-
-// Nothing can be hidden, the copy constructor is implicitly deleted.
-class Test5 {
-public:
-  template <typename T> Test5(T &&n);
-
-  Test5(Test5 &&rhs) = delete;
-};
-
-// Only the move constructor can be hidden.
-class Test6 {
-public:
-  template <typename T> Test6(T &&n);
-  // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the move constructor
-
-  Test6(Test6 &&rhs);
-  // CHECK-NOTES: :[[@LINE-1]]:3: note: move constructor declared here
-private:
-  Test6(const Test6 &rhs);
-};
-
-// Do not dereference a null BaseType.
-template <class _Callable> class result_of;
-template <class _Fp, class ..._Args> class result_of<_Fp(_Args...)> { };
-template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
-
-template <class... _Types> struct __overload;
-template <class _Tp, class... _Types>
-struct __overload<_Tp, _Types...> : __overload<_Types...> {
-  using __overload<_Types...>::operator();
-};
-
-template <class _Tp, class... _Types>
-using __best_match_t = typename result_of_t<__overload<_Types...>(_Tp&&)>::type;
-
-template <class... _Types>
-class variant {
-public:
-  template <class _Arg, class _Tp = __best_match_t<_Arg, _Types...> >
-  constexpr variant(_Arg&& __arg) {}
-  // CHECK-NOTES: :[[@LINE-1]]:13: warning: constructor accepting a forwarding reference can hide the copy and move constructors
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-inaccurate-erase.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-inaccurate-erase.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-inaccurate-erase.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-inaccurate-erase.cpp (removed)
@@ -1,101 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-inaccurate-erase %t
-// FIXME: Fix the checker to work in C++17 mode.
-
-namespace std {
-template <typename T> struct vec_iterator {
-  T ptr;
-  vec_iterator operator++(int);
-
-  template <typename X>
-  vec_iterator(const vec_iterator<X> &); // Omit enable_if<...>.
-};
-
-template <typename T> struct vector {
-  typedef vec_iterator<T*> iterator;
-
-  iterator begin();
-  iterator end();
-
-  void erase(iterator);
-  void erase(iterator, iterator);
-};
-
-template <typename T> struct vector_with_const_iterator {
-  typedef vec_iterator<T*> iterator;
-  typedef vec_iterator<const T*> const_iterator;
-
-  iterator begin();
-  iterator end();
-
-  void erase(const_iterator);
-  void erase(const_iterator, const_iterator);
-};
-
-template <typename FwIt, typename T>
-FwIt remove(FwIt begin, FwIt end, const T &val);
-
-template <typename FwIt, typename Func>
-FwIt remove_if(FwIt begin, FwIt end, Func f);
-
-template <typename FwIt> FwIt unique(FwIt begin, FwIt end);
-
-template <typename T> struct unique_ptr {};
-} // namespace std
-
-struct custom_iter {};
-struct custom_container {
-  void erase(...);
-  custom_iter begin();
-  custom_iter end();
-};
-
-template <typename T> void g() {
-  T t;
-  t.erase(std::remove(t.begin(), t.end(), 10));
-  // CHECK-FIXES: {{^  }}t.erase(std::remove(t.begin(), t.end(), 10));{{$}}
-
-  std::vector<int> v;
-  v.erase(remove(v.begin(), v.end(), 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
-  // CHECK-FIXES: {{^  }}v.erase(remove(v.begin(), v.end(), 10), v.end());{{$}}
-}
-
-#define ERASE(x, y) x.erase(remove(x.begin(), x.end(), y))
-// CHECK-FIXES: #define ERASE(x, y) x.erase(remove(x.begin(), x.end(), y))
-
-int main() {
-  std::vector<int> v;
-
-  v.erase(remove(v.begin(), v.end(), 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one item even when multiple items should be removed [bugprone-inaccurate-erase]
-  // CHECK-FIXES: {{^  }}v.erase(remove(v.begin(), v.end(), 10), v.end());{{$}}
-  v.erase(remove(v.begin(), v.end(), 20), v.end());
-
-  auto *p = &v;
-  p->erase(remove(p->begin(), p->end(), 11));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
-  // CHECK-FIXES: {{^  }}p->erase(remove(p->begin(), p->end(), 11), p->end());{{$}}
-
-  std::vector_with_const_iterator<int> v2;
-  v2.erase(remove(v2.begin(), v2.end(), 12));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
-  // CHECK-FIXES: {{^  }}v2.erase(remove(v2.begin(), v2.end(), 12), v2.end());{{$}}
-
-  // Fix is not trivial.
-  auto it = v.end();
-  v.erase(remove(v.begin(), it, 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
-  // CHECK-FIXES: {{^  }}v.erase(remove(v.begin(), it, 10));{{$}}
-
-  g<std::vector<int>>();
-  g<custom_container>();
-
-  ERASE(v, 15);
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: this call will remove at most one
-  // CHECK-FIXES: {{^  }}ERASE(v, 15);{{$}}
-
-  std::vector<std::unique_ptr<int>> vupi;
-  auto iter = vupi.begin();
-  vupi.erase(iter++);
-  // CHECK-FIXES: {{^  }}vupi.erase(iter++);{{$}}
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-incorrect-roundings.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-incorrect-roundings.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-incorrect-roundings.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-incorrect-roundings.cpp (removed)
@@ -1,86 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-incorrect-roundings %t
-
-void b(int x) {}
-
-void f1() {
-  float f;
-  double d;
-  long double ld;
-  int x;
-
-  x = (d + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings]
-  x = (d + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (f + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (f + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (0.5 + d);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (0.5f + d);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (0.5 + ld);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (0.5f + ld);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (0.5 + f);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (0.5f + f);
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
-  x = (int)(d + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(d + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(ld + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(ld + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(f + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(f + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(0.5 + d);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(0.5f + d);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(0.5 + ld);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(0.5f + ld);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(0.5 + f);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = (int)(0.5f + f);
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
-  x = static_cast<int>(d + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(d + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(ld + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(ld + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(f + 0.5);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(f + 0.5f);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(0.5 + d);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(0.5f + d);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(0.5 + ld);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(0.5f + ld);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(0.5 + f);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-  x = static_cast<int>(0.5f + f);
-  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
-
-  // Don't warn if constant is not 0.5.
-  x = (int)(d + 0.6);
-  x = (int)(0.6 + d);
-
-  // Don't warn if binary operator is not directly beneath cast.
-  x = (int)(1 + (0.5 + f));
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-infinite-loop.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-infinite-loop.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-infinite-loop.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-infinite-loop.cpp (removed)
@@ -1,320 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-infinite-loop %t -- -- -fexceptions
-
-void simple_infinite_loop1() {
-  int i = 0;
-  int j = 0;
-  while (i < 10) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
-    j++;
-  }
-
-  do {
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
-    j++;
-  } while (i < 10);
-
-  for (i = 0; i < 10; ++j) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
-  }
-}
-
-void simple_infinite_loop2() {
-  int i = 0;
-  int j = 0;
-  int Limit = 10;
-  while (i < Limit) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i, Limit) are updated in the loop body [bugprone-infinite-loop]
-    j++;
-  }
-
-  do {
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i, Limit) are updated in the loop body [bugprone-infinite-loop]
-    j++;
-  } while (i < Limit);
-
-  for (i = 0; i < Limit; ++j) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i, Limit) are updated in the loop body [bugprone-infinite-loop]
-  }
-}
-
-void simple_not_infinite1() {
-  int i = 0;
-  int Limit = 100;
-  while (i < Limit) {
-    // Not an error since 'Limit' is updated.
-    Limit--;
-  }
-  do {
-    Limit--;
-  } while (i < Limit);
-
-  for (i = 0; i < Limit; Limit--) {
-  }
-}
-
-void simple_not_infinite2() {
-  for (int i = 10; i-- > 0;) {
-    // Not an error, since loop variable is modified in its condition part.
-  }
-}
-
-int unknown_function();
-
-void function_call() {
-  int i = 0;
-  while (i < unknown_function()) {
-    // Not an error, since the function may return different values.
-  }
-
-  do {
-    // Not an error, since the function may return different values.
-  } while (i < unknown_function());
-
-  for (i = 0; i < unknown_function();) {
-    // Not an error, since the function may return different values.
-  }
-}
-
-void escape_before1() {
-  int i = 0;
-  int Limit = 100;
-  int *p = &i;
-  while (i < Limit) {
-    // Not an error, since *p is alias of i.
-    (*p)++;
-  }
-
-  do {
-    (*p)++;
-  } while (i < Limit);
-
-  for (i = 0; i < Limit; ++(*p)) {
-  }
-}
-
-void escape_before2() {
-  int i = 0;
-  int Limit = 100;
-  int &ii = i;
-  while (i < Limit) {
-    // Not an error, since ii is alias of i.
-    ii++;
-  }
-
-  do {
-    ii++;
-  } while (i < Limit);
-
-  for (i = 0; i < Limit; ++ii) {
-  }
-}
-
-void escape_inside1() {
-  int i = 0;
-  int Limit = 100;
-  int *p = &i;
-  while (i < Limit) {
-    // Not an error, since *p is alias of i.
-    int *p = &i;
-    (*p)++;
-  }
-
-  do {
-    int *p = &i;
-    (*p)++;
-  } while (i < Limit);
-}
-
-void escape_inside2() {
-  int i = 0;
-  int Limit = 100;
-  while (i < Limit) {
-    // Not an error, since ii is alias of i.
-    int &ii = i;
-    ii++;
-  }
-
-  do {
-    int &ii = i;
-    ii++;
-  } while (i < Limit);
-}
-
-void escape_after1() {
-  int i = 0;
-  int j = 0;
-  int Limit = 10;
-
-  while (i < Limit) {
-    // False negative, but difficult to detect without CFG-based analysis
-  }
-  int *p = &i;
-}
-
-void escape_after2() {
-  int i = 0;
-  int j = 0;
-  int Limit = 10;
-
-  while (i < Limit) {
-    // False negative, but difficult to detect without CFG-based analysis
-  }
-  int &ii = i;
-}
-
-int glob;
-
-void global1(int &x) {
-  int i = 0, Limit = 100;
-  while (x < Limit) {
-    // Not an error since 'x' can be an alias of 'glob'.
-    glob++;
-  }
-}
-
-void global2() {
-  int i = 0, Limit = 100;
-  while (glob < Limit) {
-    // Since 'glob' is declared out of the function we do not warn.
-    i++;
-  }
-}
-
-struct X {
-  int m;
-
-  void change_m();
-
-  void member_expr1(int i) {
-    while (i < m) {
-      // False negative: No warning, since skipping the case where a struct or
-      // class can be found in its condition.
-      ;
-    }
-  }
-
-  void member_expr2(int i) {
-    while (i < m) {
-      --m;
-    }
-  }
-
-  void member_expr3(int i) {
-    while (i < m) {
-      change_m();
-    }
-  }
-};
-
-void array_index() {
-  int i = 0;
-  int v[10];
-  while (i < 10) {
-    v[i++] = 0;
-  }
-
-  i = 0;
-  do {
-    v[i++] = 0;
-  } while (i < 9);
-
-  for (i = 0; i < 10;) {
-    v[i++] = 0;
-  }
-
-  for (i = 0; i < 10; v[i++] = 0) {
-  }
-}
-
-void no_loop_variable() {
-  while (0)
-    ;
-}
-
-void volatile_in_condition() {
-  volatile int cond = 0;
-  while (!cond) {
-  }
-}
-
-namespace std {
-template<typename T> class atomic {
-  T val;
-public:
-  atomic(T v): val(v) {};
-  operator T() { return val; };
-};
-}
-
-void atomic_in_condition() {
-  std::atomic<int> cond = 0;
-  while (!cond) {
-  }
-}
-
-void loop_exit1() {
-  int i = 0;
-  while (i) {
-    if (unknown_function())
-      break;
-  }
-}
-
-void loop_exit2() {
-  int i = 0;
-  while (i) {
-    if (unknown_function())
-      return;
-  }
-}
-
-void loop_exit3() {
-  int i = 0;
-  while (i) {
-    if (unknown_function())
-      goto end;
-  }
- end:
-  ;
-}
-
-void loop_exit4() {
-  int i = 0;
-  while (i) {
-    if (unknown_function())
-      throw 1;
-  }
-}
-
-[[noreturn]] void exit(int);
-
-void loop_exit5() {
-  int i = 0;
-  while (i) {
-    if (unknown_function())
-      exit(1);
-  }
-}
-
-void loop_exit_in_lambda() {
-  int i = 0;
-  while (i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
-    auto l = []() { return 0; };
-  }
-}
-
-void lambda_capture() {
-  int i = 0;
-  int Limit = 100;
-  int *p = &i;
-  while (i < Limit) {
-    // Not an error, since i is captured by reference in a lambda.
-    auto l = [&i]() { ++i; };
-  }
-
-  do {
-    int *p = &i;
-    (*p)++;
-  } while (i < Limit);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-integer-division.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-integer-division.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-integer-division.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-integer-division.cpp (removed)
@@ -1,130 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-integer-division %t
-
-// Functions expecting a floating-point parameter.
-void floatArg(float x) {}
-void doubleArg(double x) {}
-void longDoubleArg(long double x) {}
-
-// Functions expected to return a floating-point value.
-float singleDiv() {
-  int x = -5;
-  int y = 2;
-  return x/y;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: result of integer division used in
-}
-
-double wrongOrder(int x, int y) {
-  return x/y/0.1;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: result of integer division used in
-}
-
-long double rightOrder(int x, int y) {
-  return 0.1/x/y; // OK
-}
-
-// Typical mathematical functions.
-float sin(float);
-double acos(double);
-long double tanh(long double);
-
-namespace std {
-  using ::sin;
-}
-
-template <typename T>
-void intDivSin(T x) {
-  sin(x);
-}
-
-int intFunc(int);
-
-struct X {
-  int n;
-  void m() {
-    sin(n / 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: result of integer division used in
-  }
-};
-
-void integerDivision() {
-  char a = 2;
-  short b = -5;
-  int c = 9784;
-  enum third { x, y, z=2 };
-  third d = z;
-  char e[] = {'a', 'b', 'c'};
-  char f = *(e + 1 / a);
-  bool g = 1;
-
-  sin(1 + c / (2 + 2));
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: result of integer division used in
-  sin(c / (1 + .5));
-  sin((c + .5) / 3);
-
-  sin(intFunc(3) / 5);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: result of integer division used in
-  acos(2 / intFunc(7));
-// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
-
-  floatArg(1 + 2 / 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: result of integer division used in
-  sin(1 + 2 / 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: result of integer division used in
-  intFunc(sin(1 + 2 / 3));
-// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: result of integer division used in
-
-  floatArg(1 + intFunc(1 + 2 / 3));
-  floatArg(1 + 3 * intFunc(a / b));
-
-  1 << (2 / 3);
-  1 << intFunc(2 / 3);
-
-#define M_SIN sin(a / b);
-  M_SIN
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: result of integer division used in
-
-  intDivSin<float>(a / b);
-// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: result of integer division used in
-  intDivSin<double>(c / d);
-// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: result of integer division used in
-  intDivSin<long double>(f / g);
-// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: result of integer division used in
-
-  floatArg(1 / 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: result of integer division used in
-  doubleArg(a / b);
-// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: result of integer division used in
-  longDoubleArg(3 / d);
-// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: result of integer division used in
-  floatArg(a / b / 0.1);
-// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: result of integer division used in
-  doubleArg(1 / 3 / 0.1);
-// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: result of integer division used in
-  longDoubleArg(2 / 3 / 5);
-// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: result of integer division used in
-
-  std::sin(2 / 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: result of integer division used in
-  ::acos(7 / d);
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: result of integer division used in
-  tanh(f / g);
-// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
-
-  floatArg(0.1 / a / b);
-  doubleArg(0.1 / 3 / 1);
-
-  singleDiv();
-  wrongOrder(a,b);
-  rightOrder(a,b);
-
-  sin(a / b);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: result of integer division used in
-  acos(f / d);
-// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
-  tanh(c / g);
-// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
-
-  sin(3.0 / a);
-  acos(b / 3.14);
-  tanh(3.14 / f / g);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-lambda-function-name.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-lambda-function-name.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-lambda-function-name.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-lambda-function-name.cpp (removed)
@@ -1,41 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-lambda-function-name %t
-
-void Foo(const char* a, const char* b, int c) {}
-
-#define FUNC_MACRO Foo(__func__, "", 0)
-#define FUNCTION_MACRO Foo(__FUNCTION__, "", 0)
-#define EMBED_IN_ANOTHER_MACRO1 FUNC_MACRO
-
-void Positives() {
-  [] { __func__; }();
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
-  [] { __FUNCTION__; }();
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__FUNCTION__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
-  [] { FUNC_MACRO; }();
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
-  [] { FUNCTION_MACRO; }();
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__FUNCTION__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
-  [] { EMBED_IN_ANOTHER_MACRO1; }();
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
-}
-
-#define FUNC_MACRO_WITH_FILE_AND_LINE Foo(__func__, __FILE__, __LINE__)
-#define FUNCTION_MACRO_WITH_FILE_AND_LINE Foo(__FUNCTION__, __FILE__, __LINE__)
-#define EMBED_IN_ANOTHER_MACRO2 FUNC_MACRO_WITH_FILE_AND_LINE
-
-void Negatives() {
-  __func__;
-  __FUNCTION__;
-
-  // __PRETTY_FUNCTION__ should not trigger a warning because its value is
-  // actually potentially useful.
-  __PRETTY_FUNCTION__;
-  [] { __PRETTY_FUNCTION__; }();
-
-  // Don't warn if __func__/__FUNCTION is used inside a macro that also uses
-  // __FILE__ and __LINE__, on the assumption that __FILE__ and __LINE__ will
-  // be useful even if __func__/__FUNCTION__ is not.
-  [] { FUNC_MACRO_WITH_FILE_AND_LINE; }();
-  [] { FUNCTION_MACRO_WITH_FILE_AND_LINE; }();
-  [] { EMBED_IN_ANOTHER_MACRO2; }();
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses-cmdline.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses-cmdline.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses-cmdline.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses-cmdline.cpp (removed)
@@ -1,10 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-macro-parentheses %t -- -- -DVAL=0+0
-
-// The previous command-line is producing warnings and fixes with the source
-// locations from a virtual buffer. VAL is replaced by '0+0'.
-// Fixes could not be applied and should not be reported.
-int foo() { return VAL; }
-
-#define V 0+0
-int bar() { return V; }
-// CHECK-FIXES: #define V (0+0)

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-parentheses.cpp (removed)
@@ -1,49 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-macro-parentheses %t
-
-#define BAD1              -1
-// CHECK-MESSAGES: :[[@LINE-1]]:27: warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
-#define BAD2              1+2
-// CHECK-MESSAGES: :[[@LINE-1]]:28: warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
-#define BAD3(A)           (A+1)
-// CHECK-MESSAGES: :[[@LINE-1]]:28: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
-#define BAD4(x)           ((unsigned char)(x & 0xff))
-// CHECK-MESSAGES: :[[@LINE-1]]:44: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
-#define BAD5(X)           A*B=(C*)X+2
-// CHECK-MESSAGES: :[[@LINE-1]]:35: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
-
-#define GOOD1             1
-#define GOOD2             (1+2)
-#define GOOD3(A)          #A
-#define GOOD4(A,B)        A ## B
-#define GOOD5(T)          ((T*)0)
-#define GOOD6(B)          "A" B "C"
-#define GOOD7(b)          A b
-#define GOOD8(a)          a B
-#define GOOD9(type)       (type(123))
-#define GOOD10(car, ...)  car
-#define GOOD11            a[b+c]
-#define GOOD12(x)         a[x]
-#define GOOD13(x)         a.x
-#define GOOD14(x)         a->x
-#define GOOD15(x)         ({ int a = x; a+4; })
-#define GOOD16(x)         a_ ## x, b_ ## x = c_ ## x - 1,
-#define GOOD17            case 123: x=4+5; break;
-#define GOOD18(x)         ;x;
-#define GOOD19            ;-2;
-#define GOOD20            void*
-#define GOOD21(a)         case Fred::a:
-#define GOOD22(a)         if (verbose) return a;
-#define GOOD23(type)      (type::Field)
-#define GOOD24(t)         std::set<t> s
-#define GOOD25(t)         std::set<t,t,t> s
-#define GOOD26(x)         (a->*x)
-#define GOOD27(x)         (a.*x)
-#define GOOD28(x)         namespace x {int b;}
-#define GOOD29(...)       std::cout << __VA_ARGS__;
-#define GOOD30(args...)   std::cout << args;
-#define GOOD31(X)         A*X=2
-#define GOOD32(X)         std::vector<X>
-
-// These are allowed for now..
-#define MAYBE1            *12.34
-#define MAYBE2            <<3

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-repeated-side-effects.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-repeated-side-effects.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-repeated-side-effects.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-macro-repeated-side-effects.c (removed)
@@ -1,125 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-macro-repeated-side-effects %t
-
-#define badA(x,y)  ((x)+((x)+(y))+(y))
-void bad(int ret, int a, int b) {
-  ret = badA(a++, b);
-  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x' are repeated in macro expansion [bugprone-macro-repeated-side-effects]
-  // CHECK-NOTES: :[[@LINE-4]]:9: note: macro 'badA' defined here
-  ret = badA(++a, b);
-  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x'
-  // CHECK-NOTES: :[[@LINE-7]]:9: note: macro 'badA' defined here
-  ret = badA(a--, b);
-  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x'
-  // CHECK-NOTES: :[[@LINE-10]]:9: note: macro 'badA' defined here
-  ret = badA(--a, b);
-  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x'
-  // CHECK-NOTES: :[[@LINE-13]]:9: note: macro 'badA' defined here
-  ret = badA(a, b++);
-  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
-  // CHECK-NOTES: :[[@LINE-16]]:9: note: macro 'badA' defined here
-  ret = badA(a, ++b);
-  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
-  // CHECK-NOTES: :[[@LINE-19]]:9: note: macro 'badA' defined here
-  ret = badA(a, b--);
-  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
-  // CHECK-NOTES: :[[@LINE-22]]:9: note: macro 'badA' defined here
-  ret = badA(a, --b);
-  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
-  // CHECK-NOTES: :[[@LINE-25]]:9: note: macro 'badA' defined here
-}
-
-
-#define MIN(A,B)     ((A) < (B) ? (A) : (B))                        // single ?:
-#define LIMIT(X,A,B) ((X) < (A) ? (A) : ((X) > (B) ? (B) : (X)))    // two ?:
-void question(int x) {
-  MIN(x++, 12);
-  // CHECK-NOTES: :[[@LINE-1]]:7: warning: side effects in the 1st macro argument 'A'
-  // CHECK-NOTES: :[[@LINE-5]]:9: note: macro 'MIN' defined here
-  MIN(34, x++);
-  // CHECK-NOTES: :[[@LINE-1]]:11: warning: side effects in the 2nd macro argument 'B'
-  // CHECK-NOTES: :[[@LINE-8]]:9: note: macro 'MIN' defined here
-  LIMIT(x++, 0, 100);
-  // CHECK-NOTES: :[[@LINE-1]]:9: warning: side effects in the 1st macro argument 'X'
-  // CHECK-NOTES: :[[@LINE-10]]:9: note: macro 'LIMIT' defined here
-  LIMIT(20, x++, 100);
-  // CHECK-NOTES: :[[@LINE-1]]:13: warning: side effects in the 2nd macro argument 'A'
-  // CHECK-NOTES: :[[@LINE-13]]:9: note: macro 'LIMIT' defined here
-  LIMIT(20, 0, x++);
-  // CHECK-NOTES: :[[@LINE-1]]:16: warning: side effects in the 3rd macro argument 'B'
-  // CHECK-NOTES: :[[@LINE-16]]:9: note: macro 'LIMIT' defined here
-}
-
-// False positive: Repeated side effects is intentional.
-// It is hard to know when it's done by intention so right now we warn.
-#define UNROLL(A)    {A A}
-void fp1(int i) {
-  UNROLL({ i++; });
-  // CHECK-NOTES: :[[@LINE-1]]:10: warning: side effects in the 1st macro argument 'A'
-  // CHECK-NOTES: :[[@LINE-4]]:9: note: macro 'UNROLL' defined here
-}
-
-// Do not produce a false positive on a strchr() macro. Explanation; Currently the '?'
-// triggers the test to bail out, because it cannot evaluate __builtin_constant_p(c).
-#  define strchrs(s, c) \
-  (__extension__ (__builtin_constant_p (c) && !__builtin_constant_p (s)	      \
-		  && (c) == '\0'					      \
-		  ? (char *) __rawmemchr (s, c)				      \
-		  : __builtin_strchr (s, c)))
-char* __rawmemchr(char* a, char b) {
-  return a;
-}
-void pass(char* pstr, char ch) {
-  strchrs(pstr, ch++); // No error.
-}
-
-// Check large arguments (t=20, u=21).
-#define largeA(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y, z) \
-  ((a) + (a) + (b) + (b) + (c) + (c) + (d) + (d) + (e) + (e) + (f) + (f) + (g) + (g) +    \
-   (h) + (h) + (i) + (i) + (j) + (j) + (k) + (k) + (l) + (l) + (m) + (m) + (n) + (n) +    \
-   (o) + (o) + (p) + (p) + (q) + (q) + (r) + (r) + (s) + (s) + (t) + (t) + (u) + (u) +    \
-   (v) + (v) + (x) + (x) + (y) + (y) + (z) + (z))
-void large(int a) {
-  largeA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a++, 0, 0, 0, 0, 0, 0);
-  // CHECK-NOTES: :[[@LINE-1]]:64: warning: side effects in the 19th macro argument 's'
-  // CHECK-NOTES: :[[@LINE-8]]:9: note: macro 'largeA' defined here
-  largeA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a++, 0, 0, 0, 0, 0);
-  // CHECK-NOTES: :[[@LINE-1]]:67: warning: side effects in the 20th macro argument 't'
-  // CHECK-NOTES: :[[@LINE-11]]:9: note: macro 'largeA' defined here
-  largeA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a++, 0, 0, 0, 0);
-  // CHECK-NOTES: :[[@LINE-1]]:70: warning: side effects in the 21st macro argument 'u'
-  // CHECK-NOTES: :[[@LINE-14]]:9: note: macro 'largeA' defined here
-}
-
-// Passing macro argument as argument to __builtin_constant_p and macros.
-#define builtinbad(x)      (__builtin_constant_p(x) + (x) + (x))
-#define builtingood1(x)    (__builtin_constant_p(x) + (x))
-#define builtingood2(x)    ((__builtin_constant_p(x) && (x)) || (x))
-#define macrobad(x)        (builtingood1(x) + (x) + (x))
-#define macrogood(x)       (builtingood1(x) + (x))
-void builtins(int ret, int a) {
-  ret += builtinbad(a++);
-  // CHECK-NOTES: :[[@LINE-1]]:21: warning: side effects in the 1st macro argument 'x'
-  // CHECK-NOTES: :[[@LINE-8]]:9: note: macro 'builtinbad' defined here
-
-  ret += builtingood1(a++);
-  ret += builtingood2(a++);
-
-  ret += macrobad(a++);
-  // CHECK-NOTES: :[[@LINE-1]]:19: warning: side effects in the 1st macro argument 'x'
-  // CHECK-NOTES: :[[@LINE-12]]:9: note: macro 'macrobad' defined here
-
-  ret += macrogood(a++);
-}
-
-// Bail out for conditionals.
-#define condB(x,y)  if(x) {x=y;} else {x=y + 1;}
-void conditionals(int a, int b)
-{
-  condB(a, b++);
-}
-
-void log(const char *s, int v);
-#define LOG(val) log(#val, (val))
-void test_log(int a) {
-  LOG(a++);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.c (removed)
@@ -1,85 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-misplaced-operator-in-strlen-in-alloc %t
-
-typedef __typeof(sizeof(int)) size_t;
-void *malloc(size_t);
-void *alloca(size_t);
-void *calloc(size_t, size_t);
-void *realloc(void *, size_t);
-
-size_t strlen(const char *);
-size_t strnlen(const char *, size_t);
-size_t strnlen_s(const char *, size_t);
-
-typedef unsigned wchar_t;
-
-size_t wcslen(const wchar_t *);
-size_t wcsnlen(const wchar_t *, size_t);
-size_t wcsnlen_s(const wchar_t *, size_t);
-
-void bad_malloc(char *name) {
-  char *new_name = (char *)malloc(strlen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)malloc\(}}strlen(name) + 1{{\);$}}
-  new_name = (char *)malloc(strnlen(name + 1, 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: addition operator is applied to the argument of strnlen
-  // CHECK-FIXES: {{^  new_name = \(char \*\)malloc\(}}strnlen(name, 10) + 1{{\);$}}
-  new_name = (char *)malloc(strnlen_s(name + 1, 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: addition operator is applied to the argument of strnlen_s
-  // CHECK-FIXES: {{^  new_name = \(char \*\)malloc\(}}strnlen_s(name, 10) + 1{{\);$}}
-}
-
-void bad_malloc_wide(wchar_t *name) {
-  wchar_t *new_name = (wchar_t *)malloc(wcslen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: addition operator is applied to the argument of wcslen
-  // CHECK-FIXES: {{^  wchar_t \*new_name = \(wchar_t \*\)malloc\(}}wcslen(name) + 1{{\);$}}
-  new_name = (wchar_t *)malloc(wcsnlen(name + 1, 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: addition operator is applied to the argument of wcsnlen
-  // CHECK-FIXES: {{^  new_name = \(wchar_t \*\)malloc\(}}wcsnlen(name, 10) + 1{{\);$}}
-  new_name = (wchar_t *)malloc(wcsnlen_s(name + 1, 10));
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: addition operator is applied to the argument of wcsnlen_s
-  // CHECK-FIXES: {{^  new_name = \(wchar_t \*\)malloc\(}}wcsnlen_s(name, 10) + 1{{\);$}}
-}
-
-void bad_alloca(char *name) {
-  char *new_name = (char *)alloca(strlen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)alloca\(}}strlen(name) + 1{{\);$}}
-}
-
-void bad_calloc(char *name) {
-  char *new_names = (char *)calloc(2, strlen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_names = \(char \*\)calloc\(2, }}strlen(name) + 1{{\);$}}
-}
-
-void bad_realloc(char *old_name, char *name) {
-  char *new_name = (char *)realloc(old_name, strlen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)realloc\(old_name, }}strlen(name) + 1{{\);$}}
-}
-
-void intentional1(char *name) {
-  char *new_name = (char *)malloc(strlen(name + 1) + 1);
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // We have + 1 outside as well so we assume this is intentional
-}
-
-void intentional2(char *name) {
-  char *new_name = (char *)malloc(strlen(name + 2));
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // Only give warning for + 1, not + 2
-}
-
-void intentional3(char *name) {
-  char *new_name = (char *)malloc(strlen((name + 1)));
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // If expression is in extra parentheses, consider it as intentional
-}
-
-void (*(*const alloc_ptr)(size_t)) = malloc;
-
-void bad_indirect_alloc(char *name) {
-  char *new_name = (char *)alloc_ptr(strlen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)alloc_ptr\(}}strlen(name) + 1{{\);$}}
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.cpp (removed)
@@ -1,58 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-misplaced-operator-in-strlen-in-alloc %t
-
-namespace std {
-typedef __typeof(sizeof(int)) size_t;
-void *malloc(size_t);
-
-size_t strlen(const char *);
-} // namespace std
-
-namespace non_std {
-typedef __typeof(sizeof(int)) size_t;
-void *malloc(size_t);
-
-size_t strlen(const char *);
-} // namespace non_std
-
-void bad_std_malloc_std_strlen(char *name) {
-  char *new_name = (char *)std::malloc(std::strlen(name + 1));
-  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)std::malloc\(}}std::strlen(name) + 1{{\);$}}
-}
-
-void ignore_non_std_malloc_std_strlen(char *name) {
-  char *new_name = (char *)non_std::malloc(std::strlen(name + 1));
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // Ignore functions of the malloc family in custom namespaces
-}
-
-void ignore_std_malloc_non_std_strlen(char *name) {
-  char *new_name = (char *)std::malloc(non_std::strlen(name + 1));
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
-  // Ignore functions of the strlen family in custom namespaces
-}
-
-void bad_new_strlen(char *name) {
-  char *new_name = new char[std::strlen(name + 1)];
-  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  char \*new_name = new char\[}}std::strlen(name) + 1{{\];$}}
-}
-
-void good_new_strlen(char *name) {
-  char *new_name = new char[std::strlen(name) + 1];
-  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:20: warning: addition operator is applied to the argument of strlen
-}
-
-class C {
-  char c;
-public:
-  static void *operator new[](std::size_t count) {
-    return ::operator new(count);
-  }
-};
-
-void bad_custom_new_strlen(char *name) {
-  C *new_name = new C[std::strlen(name + 1)];
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: addition operator is applied to the argument of strlen
-  // CHECK-FIXES: {{^  C \*new_name = new C\[}}std::strlen(name) + 1{{\];$}}
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-explicit-only.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-explicit-only.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-explicit-only.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-explicit-only.cpp (removed)
@@ -1,82 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: 0}]}" --
-
-void func(long arg) {}
-
-void assign(int a, int b) {
-  long l;
-
-  l = a * b;
-  l = (long)(a * b);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long' is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
-  l = (long)a * b;
-
-  l = a << 8;
-  l = (long)(a << 8);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = (long)b << 8;
-
-  l = static_cast<long>(a * b);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-}
-
-void compare(int a, int b, long c) {
-  bool l;
-
-  l = a * b == c;
-  l = c == a * b;
-  l = (long)(a * b) == c;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = c == (long)(a * b);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
-  l = (long)a * b == c;
-  l = c == (long)a * b;
-}
-
-void init(unsigned int n) {
-  long l1 = n << 8;
-  long l2 = (long)(n << 8);
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: either cast from 'unsigned int' to 'long'
-  long l3 = (long)n << 8;
-}
-
-void call(unsigned int n) {
-  func(n << 8);
-  func((long)(n << 8));
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: either cast from 'unsigned int' to 'long'
-  func((long)n << 8);
-}
-
-long ret(int a) {
-  if (a < 0) {
-    return a * 1000;
-  } else if (a > 0) {
-    return (long)(a * 1000);
-    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
-  } else {
-    return (long)a * 1000;
-  }
-}
-
-// Shall not generate an assert. https://bugs.llvm.org/show_bug.cgi?id=33660
-template <class> class A {
-  enum Type {};
-  static char *m_fn1() { char p = (Type)(&p - m_fn1()); }
-};
-
-enum DaysEnum {
-  MON,
-  TUE,
-  WED,
-  THR,
-  FRI,
-  SAT,
-  SUN
-};
-
-// Do not warn for int to enum casts.
-void nextDay(DaysEnum day) {
-  if (day < SUN)
-    day = (DaysEnum)(day + 1);
-  if (day < SUN)
-    day = static_cast<DaysEnum>(day + 1);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-implicit-enabled.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-implicit-enabled.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-implicit-enabled.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-misplaced-widening-cast-implicit-enabled.cpp (removed)
@@ -1,101 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: 1}]}" --
-
-void func(long arg) {}
-
-void assign(int a, int b) {
-  long l;
-
-  l = a * b;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long' is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
-  l = (long)(a * b);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = (long)a * b;
-
-  l = a << 8;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = (long)(a << 8);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = (long)b << 8;
-
-  l = static_cast<long>(a * b);
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-}
-
-void compare(int a, int b, long c) {
-  bool l;
-
-  l = a * b == c;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = c == a * b;
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
-  l = (long)(a * b) == c;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
-  l = c == (long)(a * b);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
-  l = (long)a * b == c;
-  l = c == (long)a * b;
-}
-
-void init(unsigned int n) {
-  long l1 = n << 8;
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: either cast from 'unsigned int' to 'long'
-  long l2 = (long)(n << 8);
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: either cast from 'unsigned int' to 'long'
-  long l3 = (long)n << 8;
-}
-
-void call(unsigned int n) {
-  func(n << 8);
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: either cast from 'unsigned int' to 'long'
-  func((long)(n << 8));
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: either cast from 'unsigned int' to 'long'
-  func((long)n << 8);
-}
-
-long ret(int a) {
-  if (a < 0) {
-    return a * 1000;
-    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
-  } else if (a > 0) {
-    return (long)(a * 1000);
-    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
-  } else {
-    return (long)a * 1000;
-  }
-}
-
-void dontwarn1(unsigned char a, int i, unsigned char *p) {
-  long l;
-  // The result is a 9 bit value, there is no truncation in the implicit cast.
-  l = (long)(a + 15);
-  // The result is a 12 bit value, there is no truncation in the implicit cast.
-  l = (long)(a << 4);
-  // The result is a 3 bit value, there is no truncation in the implicit cast.
-  l = (long)((i % 5) + 1);
-  // The result is a 16 bit value, there is no truncation in the implicit cast.
-  l = (long)(((*p) << 8) + *(p + 1));
-}
-
-template <class T> struct DontWarn2 {
-  void assign(T a, T b) {
-    long l;
-    l = (long)(a * b);
-  }
-};
-DontWarn2<int> DW2;
-
-// Cast is not suspicious when casting macro.
-#define A  (X<<2)
-long macro1(int X) {
-  return (long)A;
-}
-
-// Don't warn about cast in macro.
-#define B(X,Y)   (long)(X*Y)
-long macro2(int x, int y) {
-  return B(x,y);
-}
-
-void floatingpoint(float a, float b) {
-  double d = (double)(a * b); // Currently we don't warn for this.
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-move-forwarding-reference.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-move-forwarding-reference.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-move-forwarding-reference.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-move-forwarding-reference.cpp (removed)
@@ -1,125 +0,0 @@
-// RUN: %check_clang_tidy -std=c++14-or-later %s bugprone-move-forwarding-reference %t -- -- -fno-delayed-template-parsing
-
-namespace std {
-template <typename> struct remove_reference;
-
-template <typename _Tp> struct remove_reference { typedef _Tp type; };
-
-template <typename _Tp> struct remove_reference<_Tp &> { typedef _Tp type; };
-
-template <typename _Tp> struct remove_reference<_Tp &&> { typedef _Tp type; };
-
-template <typename _Tp>
-constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t);
-
-} // namespace std
-
-// Standard case.
-template <typename T, typename U> void f1(U &&SomeU) {
-  T SomeT(std::move(SomeU));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-  // CHECK-FIXES: T SomeT(std::forward<U>(SomeU));
-}
-
-// Ignore parentheses around the argument to std::move().
-template <typename T, typename U> void f2(U &&SomeU) {
-  T SomeT(std::move((SomeU)));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-  // CHECK-FIXES: T SomeT(std::forward<U>((SomeU)));
-}
-
-// Handle the case correctly where std::move() is being used through a using
-// declaration.
-template <typename T, typename U> void f3(U &&SomeU) {
-  using std::move;
-  T SomeT(move(SomeU));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-  // CHECK-FIXES: T SomeT(std::forward<U>(SomeU));
-}
-
-// Handle the case correctly where a global specifier is prepended to
-// std::move().
-template <typename T, typename U> void f4(U &&SomeU) {
-  T SomeT(::std::move(SomeU));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-  // CHECK-FIXES: T SomeT(::std::forward<U>(SomeU));
-}
-
-// Create a correct fix if there are spaces around the scope resolution
-// operator.
-template <typename T, typename U> void f5(U &&SomeU) {
-  {
-    T SomeT(::  std  ::  move(SomeU));
-    // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: forwarding reference passed to
-    // CHECK-FIXES: T SomeT(::std::forward<U>(SomeU));
-  }
-  {
-    T SomeT(std  ::  move(SomeU));
-    // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: forwarding reference passed to
-    // CHECK-FIXES: T SomeT(std::forward<U>(SomeU));
-  }
-}
-
-// Ignore const rvalue reference parameters.
-template <typename T, typename U> void f6(const U &&SomeU) {
-  T SomeT(std::move(SomeU));
-}
-
-// Ignore the case where the argument to std::move() is a lambda parameter (and
-// thus not actually a parameter of the function template).
-template <typename T, typename U> void f7() {
-  [](U &&SomeU) { T SomeT(std::move(SomeU)); };
-}
-
-// Ignore the case where the argument is a lvalue reference.
-template <typename T, typename U> void f8(U &SomeU) {
-  T SomeT(std::move(SomeU));
-}
-
-// Ignore the case where the template parameter is a class template parameter
-// (i.e. no template argument deduction is taking place).
-template <typename T, typename U> class SomeClass {
-  void f(U &&SomeU) { T SomeT(std::move(SomeU)); }
-};
-
-// Ignore the case where the function parameter in the template isn't an rvalue
-// reference but the template argument is explicitly set to be an rvalue
-// reference.
-class A {};
-template <typename T> void foo(T);
-void f8() {
-  A a;
-  foo<A &&>(std::move(a));
-}
-
-// A warning is output, but no fix is suggested, if a macro is used to rename
-// std::move.
-#define MOVE(x) std::move((x))
-template <typename T, typename U> void f9(U &&SomeU) {
-  T SomeT(MOVE(SomeU));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-}
-
-// Same result if the argument is passed outside of the macro.
-#undef MOVE
-#define MOVE std::move
-template <typename T, typename U> void f10(U &&SomeU) {
-  T SomeT(MOVE(SomeU));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-}
-
-// Same result if the macro does not include the "std" namespace.
-#undef MOVE
-#define MOVE move
-template <typename T, typename U> void f11(U &&SomeU) {
-  T SomeT(std::MOVE(SomeU));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
-}
-
-// Handle the case correctly where the forwarding reference is a parameter of a
-// generic lambda.
-template <typename T> void f12() {
-  [] (auto&& x) { T SomeT(std::move(x)); };
-  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: forwarding reference passed to
-  // CHECK-FIXES: [] (auto&& x) { T SomeT(std::forward<decltype(x)>(x)); }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-multiple-statement-macro.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-multiple-statement-macro.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-multiple-statement-macro.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-multiple-statement-macro.cpp (removed)
@@ -1,85 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-multiple-statement-macro %t
-
-void F();
-
-#define BAD_MACRO(x) \
-  F();               \
-  F()
-
-#define GOOD_MACRO(x) \
-  do {                \
-    F();              \
-    F();              \
-  } while (0)
-
-#define GOOD_MACRO2(x) F()
-
-#define GOOD_MACRO3(x) F();
-
-#define MACRO_ARG_MACRO(X) \
-  if (54)                  \
-  X(2)
-
-#define ALL_IN_MACRO(X) \
-  if (43)               \
-    F();                \
-  F()
-
-#define GOOD_NESTED(x)   \
-  if (x)            \
-    GOOD_MACRO3(x); \
-  F();
-
-#define IF(x) if(x)
-
-void positives() {
-  if (1)
-    BAD_MACRO(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used without braces; some statements will be unconditionally executed [bugprone-multiple-statement-macro]
-  if (1) {
-  } else
-    BAD_MACRO(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used
-  while (1)
-    BAD_MACRO(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used
-  for (;;)
-    BAD_MACRO(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used
-
-  MACRO_ARG_MACRO(BAD_MACRO);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: multiple statement macro used
-  MACRO_ARG_MACRO(F(); int);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: multiple statement macro used
-  IF(1) BAD_MACRO(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: multiple statement macro used
-}
-
-void negatives() {
-  if (1) {
-    BAD_MACRO(1);
-  } else {
-    BAD_MACRO(1);
-  }
-  while (1) {
-    BAD_MACRO(1);
-  }
-  for (;;) {
-    BAD_MACRO(1);
-  }
-
-  if (1)
-    GOOD_MACRO(1);
-  if (1) {
-    GOOD_MACRO(1);
-  }
-  if (1)
-    GOOD_MACRO2(1);
-  if (1)
-    GOOD_MACRO3(1);
-
-  MACRO_ARG_MACRO(GOOD_MACRO);
-  ALL_IN_MACRO(1);
-
-  IF(1) GOOD_MACRO(1);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-parent-virtual-call.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-parent-virtual-call.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-parent-virtual-call.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-parent-virtual-call.cpp (removed)
@@ -1,179 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-parent-virtual-call %t
-
-extern int foo();
-
-class A {
-public:
-  A() = default;
-  virtual ~A() = default;
-
-  virtual int virt_1() { return foo() + 1; }
-  virtual int virt_2() { return foo() + 2; }
-
-  int non_virt() { return foo() + 3; }
-  static int stat() { return foo() + 4; }
-};
-
-class B : public A {
-public:
-  B() = default;
-
-  // Nothing to fix: calls to direct parent.
-  int virt_1() override { return A::virt_1() + 3; }
-  int virt_2() override { return A::virt_2() + 4; }
-};
-
-class C : public B {
-public:
-  int virt_1() override { return A::virt_1() + B::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' refers to a member overridden in subclass; did you mean 'B'? [bugprone-parent-virtual-call]
-  // CHECK-FIXES:  int virt_1() override { return B::virt_1() + B::virt_1(); }
-  int virt_2() override { return A::virt_1() + B::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'B'? {{.*}}
-  // CHECK-FIXES:  int virt_2() override { return B::virt_1() + B::virt_1(); }
-
-  // Test that non-virtual and static methods are not affected by this cherker.
-  int method_c() { return A::stat() + A::non_virt(); }
-};
-
-// Check aliased type names
-using A1 = A;
-typedef A A2;
-#define A3 A
-
-class C2 : public B {
-public:
-  int virt_1() override { return A1::virt_1() + A2::virt_1() + A3::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A1::virt_1' {{.*}}; did you mean 'B'? {{.*}}
-  // CHECK-MESSAGES: :[[@LINE-2]]:49: warning: qualified name 'A2::virt_1' {{.*}}; did you mean 'B'? {{.*}}
-  // CHECK-MESSAGES: :[[@LINE-3]]:64: warning: qualified name 'A3::virt_1' {{.*}}; did you mean 'B'? {{.*}}
-  // CHECK-FIXES:  int virt_1() override { return B::virt_1() + B::virt_1() + B::virt_1(); }
-};
-
-// Test that the check affects grand-grand..-parent calls too.
-class D : public C {
-public:
-  int virt_1() override { return A::virt_1() + B::virt_1() + D::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'C'? {{.*}}
-  // CHECK-MESSAGES: :[[@LINE-2]]:48: warning: qualified name 'B::virt_1' {{.*}}; did you mean 'C'? {{.*}}
-  // CHECK-FIXES:  int virt_1() override { return C::virt_1() + C::virt_1() + D::virt_1(); }
-  int virt_2() override { return A::virt_1() + B::virt_1() + D::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'C'? {{.*}}
-  // CHECK-MESSAGES: :[[@LINE-2]]:48: warning: qualified name 'B::virt_1' {{.*}}; did you mean 'C'? {{.*}}
-  // CHECK-FIXES:  int virt_2() override { return C::virt_1() + C::virt_1() + D::virt_1(); }
-};
-
-// Test classes in namespaces.
-namespace {
-class BN : public A {
-public:
-  int virt_1() override { return A::virt_1() + 3; }
-  int virt_2() override { return A::virt_2() + 4; }
-};
-} // namespace
-
-namespace N1 {
-class A {
-public:
-  A() = default;
-  virtual int virt_1() { return foo() + 1; }
-  virtual int virt_2() { return foo() + 2; }
-};
-} // namespace N1
-
-namespace N2 {
-class BN : public N1::A {
-public:
-  int virt_1() override { return A::virt_1() + 3; }
-  int virt_2() override { return A::virt_2() + 4; }
-};
-} // namespace N2
-
-class CN : public BN {
-public:
-  int virt_1() override { return A::virt_1() + BN::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'BN'? {{.*}}
-  // CHECK-FIXES:  int virt_1() override { return BN::virt_1() + BN::virt_1(); }
-  int virt_2() override { return A::virt_1() + BN::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'BN'? {{.*}}
-  // CHECK-FIXES:  int virt_2() override { return BN::virt_1() + BN::virt_1(); }
-};
-
-class CNN : public N2::BN {
-public:
-  int virt_1() override { return N1::A::virt_1() + N2::BN::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'N1::A::virt_1' {{.*}}; did you mean 'N2::BN'? {{.*}}
-  // CHECK-FIXES:  int virt_1() override { return N2::BN::virt_1() + N2::BN::virt_1(); }
-  int virt_2() override { return N1::A::virt_1() + N2::BN::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'N1::A::virt_1' {{.*}}; did you mean 'N2::BN'? {{.*}}
-  // CHECK-FIXES:  int virt_2() override { return N2::BN::virt_1() + N2::BN::virt_1(); }
-};
-
-// Test multiple inheritance fixes
-class AA {
-public:
-  AA() = default;
-  virtual ~AA() = default;
-
-  virtual int virt_1() { return foo() + 1; }
-  virtual int virt_2() { return foo() + 2; }
-
-  int non_virt() { return foo() + 3; }
-  static int stat() { return foo() + 4; }
-};
-
-class BB_1 : virtual public AA {
-public:
-  BB_1() = default;
-
-  // Nothing to fix: calls to parent.
-  int virt_1() override { return AA::virt_1() + 3; }
-  int virt_2() override { return AA::virt_2() + 4; }
-};
-
-class BB_2 : virtual public AA {
-public:
-  BB_2() = default;
-  int virt_1() override { return AA::virt_1() + 3; }
-};
-
-class CC : public BB_1, public BB_2 {
-public:
-  int virt_1() override { return AA::virt_1() + 3; }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'AA::virt_1' refers to a member overridden in subclasses; did you mean 'BB_1' or 'BB_2'? {{.*}}
-  // No fix available due to multiple choice of parent class.
-};
-
-// Test that virtual method is not diagnosed as not overridden in parent.
-class BI : public A {
-public:
-  BI() = default;
-};
-
-class CI : BI {
-  int virt_1() override { return A::virt_1(); }
-};
-
-// Test templated classes.
-template <class F> class BF : public A {
-public:
-  int virt_1() override { return A::virt_1() + 3; }
-};
-
-// Test templated parent class.
-class CF : public BF<int> {
-public:
-  int virt_1() override { return A::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'BF'? {{.*}}
-};
-
-// Test both templated class and its parent class.
-template <class F> class DF : public BF<F> {
-public:
-  DF() = default;
-  int virt_1() override { return A::virt_1(); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: qualified name 'A::virt_1' {{.*}}; did you mean 'BF'? {{.*}}
-};
-
-// Just to instantiate DF<F>.
-int bar() { return (new DF<int>())->virt_1(); }

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-posix-return.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-posix-return.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-posix-return.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-posix-return.cpp (removed)
@@ -1,207 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-posix-return %t
-
-#define NULL nullptr
-#define ZERO 0
-#define NEGATIVE_ONE -1
-
-typedef int pid_t;
-typedef long off_t;
-typedef decltype(sizeof(int)) size_t;
-typedef struct __posix_spawn_file_actions* posix_spawn_file_actions_t;
-typedef struct __posix_spawnattr* posix_spawnattr_t;
-# define __CPU_SETSIZE 1024
-# define __NCPUBITS (8 * sizeof (__cpu_mask))
-typedef unsigned long int __cpu_mask;
-typedef struct
-{
-  __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
-} cpu_set_t;
-typedef struct _opaque_pthread_t *__darwin_pthread_t;
-typedef __darwin_pthread_t pthread_t;
-typedef struct pthread_attr_t_ *pthread_attr_t;
-
-extern "C" int posix_fadvise(int fd, off_t offset, off_t len, int advice);
-extern "C" int posix_fallocate(int fd, off_t offset, off_t len);
-extern "C" int posix_madvise(void *addr, size_t len, int advice);
-extern "C" int posix_memalign(void **memptr, size_t alignment, size_t size);
-extern "C" int posix_openpt(int flags);
-extern "C" int posix_spawn(pid_t *pid, const char *path,
-                const posix_spawn_file_actions_t *file_actions,
-                const posix_spawnattr_t *attrp,
-                char *const argv[], char *const envp[]);
-extern "C" int posix_spawnp(pid_t *pid, const char *file,
-                 const posix_spawn_file_actions_t *file_actions,
-                 const posix_spawnattr_t *attrp,
-                 char *const argv[], char *const envp[]);
-extern "C" int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
-extern "C" int pthread_attr_setaffinity_np(pthread_attr_t *attr, size_t cpusetsize, const cpu_set_t *cpuset);
-extern "C" int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
-extern "C" int pthread_attr_init(pthread_attr_t *attr);
-extern "C" int pthread_yield(void);
-
-
-void warningLessThanZero() {
-  if (posix_fadvise(0, 0, 0, 0) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: the comparison always evaluates to false because posix_fadvise always returns non-negative values
-  // CHECK-FIXES: posix_fadvise(0, 0, 0, 0) > 0
-  if (posix_fallocate(0, 0, 0) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:32: warning:
-  // CHECK-FIXES: posix_fallocate(0, 0, 0) > 0
-  if (posix_madvise(NULL, 0, 0) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  // CHECK-FIXES: posix_madvise(NULL, 0, 0) > 0
-  if (posix_memalign(NULL, 0, 0) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning:
-  // CHECK-FIXES: posix_memalign(NULL, 0, 0) > 0
-  if (posix_spawn(NULL, NULL, NULL, NULL, {NULL}, {NULL}) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:59: warning:
-  // CHECK-FIXES: posix_spawn(NULL, NULL, NULL, NULL, {NULL}, {NULL}) > 0
-  if (posix_spawnp(NULL, NULL, NULL, NULL, {NULL}, {NULL}) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:60: warning:
-  // CHECK-FIXES: posix_spawnp(NULL, NULL, NULL, NULL, {NULL}, {NULL}) > 0
-  if (pthread_create(NULL, NULL, NULL, NULL) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: the comparison always evaluates to false because pthread_create always returns non-negative values
-  // CHECK-FIXES: pthread_create(NULL, NULL, NULL, NULL) > 0
-  if (pthread_attr_setaffinity_np(NULL, 0, NULL) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:50: warning:
-  // CHECK-FIXES: pthread_attr_setaffinity_np(NULL, 0, NULL) > 0
-  if (pthread_attr_setschedpolicy(NULL, 0) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:44: warning:
-  // CHECK-FIXES: pthread_attr_setschedpolicy(NULL, 0) > 0)
-  if (pthread_attr_init(NULL) < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning:
-  // CHECK-FIXES: pthread_attr_init(NULL) > 0
-  if (pthread_yield() < 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning:
-  // CHECK-FIXES: pthread_yield() > 0
-
-}
-
-void warningAlwaysTrue() {
-  if (posix_fadvise(0, 0, 0, 0) >= 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: the comparison always evaluates to true because posix_fadvise always returns non-negative values
-  if (pthread_create(NULL, NULL, NULL, NULL) >= 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: the comparison always evaluates to true because pthread_create always returns non-negative values
-  if (pthread_attr_setaffinity_np(NULL, 0, NULL) >= 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:50: warning:
-  if (pthread_attr_setschedpolicy(NULL, 0) >= 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:44: warning:
-  if (pthread_attr_init(NULL) >= 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning:
-  if (pthread_yield() >= 0) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning:
-
-}
-
-void warningEqualsNegative() {
-  if (posix_fadvise(0, 0, 0, 0) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: posix_fadvise
-  if (posix_fadvise(0, 0, 0, 0) != -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fadvise(0, 0, 0, 0) <= -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fadvise(0, 0, 0, 0) < -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fallocate(0, 0, 0) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:32: warning:
-  if (posix_madvise(NULL, 0, 0) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_memalign(NULL, 0, 0) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning:
-  if (posix_spawn(NULL, NULL, NULL, NULL, {NULL}, {NULL}) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:59: warning:
-  if (posix_spawnp(NULL, NULL, NULL, NULL, {NULL}, {NULL}) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:60: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) == -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: pthread_create
-  if (pthread_create(NULL, NULL, NULL, NULL) != -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) <= -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) < -1) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-
-}
-
-void WarningWithMacro() {
-  if (posix_fadvise(0, 0, 0, 0) < ZERO) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  // CHECK-FIXES: posix_fadvise(0, 0, 0, 0) > ZERO
-  if (posix_fadvise(0, 0, 0, 0) >= ZERO) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fadvise(0, 0, 0, 0) == NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fadvise(0, 0, 0, 0) != NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fadvise(0, 0, 0, 0) <= NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (posix_fadvise(0, 0, 0, 0) < NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) < ZERO) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  // CHECK-FIXES: pthread_create(NULL, NULL, NULL, NULL) > ZERO
-  if (pthread_create(NULL, NULL, NULL, NULL) >= ZERO) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) == NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) != NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) <= NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-  if (pthread_create(NULL, NULL, NULL, NULL) < NEGATIVE_ONE) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning:
-
-}
-
-void noWarning() {
-  if (posix_openpt(0) < 0) {}
-  if (posix_openpt(0) <= 0) {}
-  if (posix_openpt(0) == -1) {}
-  if (posix_openpt(0) != -1) {}
-  if (posix_openpt(0) <= -1) {}
-  if (posix_openpt(0) < -1) {}
-  if (posix_fadvise(0, 0, 0, 0) <= 0) {}
-  if (posix_fadvise(0, 0, 0, 0) == 1) {}
-}
-
-namespace i {
-int posix_fadvise(int fd, off_t offset, off_t len, int advice);
-int pthread_yield(void);
-
-void noWarning() {
-  if (posix_fadvise(0, 0, 0, 0) < 0) {}
-  if (posix_fadvise(0, 0, 0, 0) >= 0) {}
-  if (posix_fadvise(0, 0, 0, 0) == -1) {}
-  if (posix_fadvise(0, 0, 0, 0) != -1) {}
-  if (posix_fadvise(0, 0, 0, 0) <= -1) {}
-  if (posix_fadvise(0, 0, 0, 0) < -1) {}
-    if (pthread_yield() < 0) {}
-    if (pthread_yield() >= 0) {}
-    if (pthread_yield() == -1) {}
-    if (pthread_yield() != -1) {}
-    if (pthread_yield() <= -1) {}
-    if (pthread_yield() < -1) {}
-}
-
-} // namespace i
-
-class G {
- public:
-  int posix_fadvise(int fd, off_t offset, off_t len, int advice);
-  int pthread_yield(void);
-
-  void noWarning() {
-    if (posix_fadvise(0, 0, 0, 0) < 0) {}
-    if (posix_fadvise(0, 0, 0, 0) >= 0) {}
-    if (posix_fadvise(0, 0, 0, 0) == -1) {}
-    if (posix_fadvise(0, 0, 0, 0) != -1) {}
-    if (posix_fadvise(0, 0, 0, 0) <= -1) {}
-    if (posix_fadvise(0, 0, 0, 0) < -1) {}
-    if (pthread_yield() < 0) {}
-    if (pthread_yield() >= 0) {}
-    if (pthread_yield() == -1) {}
-    if (pthread_yield() != -1) {}
-    if (pthread_yield() <= -1) {}
-    if (pthread_yield() < -1) {}
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-container.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-container.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-container.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-container.cpp (removed)
@@ -1,103 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-sizeof-container %t -- -- -target x86_64-unknown-unknown
-
-namespace std {
-
-typedef unsigned int size_t;
-
-template <typename T>
-struct basic_string {
-  size_t size() const;
-};
-
-template <typename T>
-basic_string<T> operator+(const basic_string<T> &, const T *);
-
-typedef basic_string<char> string;
-
-template <typename T>
-struct vector {
-  size_t size() const;
-};
-
-// std::bitset<> is not a container. sizeof() is reasonable for it.
-template <size_t N>
-struct bitset {
-  size_t size() const;
-};
-
-// std::array<> is, well, an array. sizeof() is reasonable for it.
-template <typename T, size_t N>
-struct array {
-  size_t size() const;
-};
-
-class fake_container1 {
-  size_t size() const; // non-public
-};
-
-struct fake_container2 {
-  size_t size(); // non-const
-};
-
-}
-
-using std::size_t;
-
-#define ARRAYSIZE(a) \
-  ((sizeof(a) / sizeof(*(a))) / static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
-
-#define ARRAYSIZE2(a) \
-  (((sizeof(a)) / (sizeof(*(a)))) / static_cast<size_t>(!((sizeof(a)) % (sizeof(*(a))))))
-
-struct string {
-  std::size_t size() const;
-};
-
-template<typename T>
-void g(T t) {
-  (void)sizeof(t);
-}
-
-void f() {
-  string s1;
-  std::string s2;
-  std::vector<int> v;
-
-  int a = 42 + sizeof(s1);
-// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: sizeof() doesn't return the size of the container; did you mean .size()? [bugprone-sizeof-container]
-  a = 123 * sizeof(s2);
-// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: sizeof() doesn't return the size
-  a = 45 + sizeof(s2 + "asdf");
-// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: sizeof() doesn't return the size
-  a = sizeof(v);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: sizeof() doesn't return the size
-  a = sizeof(std::vector<int>{});
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: sizeof() doesn't return the size
-
-  a = sizeof(a);
-  a = sizeof(int);
-  a = sizeof(std::string);
-  a = sizeof(std::vector<int>);
-
-  g(s1);
-  g(s2);
-  g(v);
-
-  std::fake_container1 fake1;
-  std::fake_container2 fake2;
-  std::bitset<7> std_bitset;
-  std::array<int, 3> std_array;
-
-  a = sizeof(fake1);
-  a = sizeof(fake2);
-  a = sizeof(std_bitset);
-  a = sizeof(std_array);
-
-
-  std::string arr[3];
-  a = ARRAYSIZE(arr);
-  a = ARRAYSIZE2(arr);
-  a = sizeof(arr) / sizeof(arr[0]);
-
-  (void)a;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-expression.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-expression.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-expression.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-sizeof-expression.cpp (removed)
@@ -1,297 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- -config="{CheckOptions: [{key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression, value: 1}]}" --
-
-class C {
-  int size() { return sizeof(this); }
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: suspicious usage of 'sizeof(this)'
-};
-
-#define LEN 8
-
-int X;
-extern int A[10];
-extern short B[10];
-
-#pragma pack(1)
-struct  S { char a, b, c; };
-
-enum E { E_VALUE = 0 };
-enum class EC { VALUE = 0 };
-
-bool AsBool() { return false; }
-int AsInt() { return 0; }
-E AsEnum() { return E_VALUE; }
-EC AsEnumClass() { return EC::VALUE; }
-S AsStruct() { return {}; }
-
-struct M {
-  int AsInt() { return 0; }
-  E AsEnum() { return E_VALUE; }
-  S AsStruct() { return {}; }
-};
-
-int ReturnOverload(int) { return {}; }
-S ReturnOverload(S) { return {}; }
-
-template <class T>
-T ReturnTemplate(T) { return {}; }
-
-template <class T>
-bool TestTrait1() {
-  return sizeof(ReturnOverload(T{})) == sizeof(A);
-}
-
-template <class T>
-bool TestTrait2() {
-  return sizeof(ReturnTemplate(T{})) == sizeof(A);
-}
-
-template <class T>
-bool TestTrait3() {
-  return sizeof(ReturnOverload(0)) == sizeof(T{});
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-}
-
-template <class T>
-bool TestTrait4() {
-  return sizeof(ReturnTemplate(0)) == sizeof(T{});
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-}
-
-bool TestTemplates() {
-  bool b = true;
-  b &= TestTrait1<int>();
-  b &= TestTrait1<S>();
-  b &= TestTrait2<int>();
-  b &= TestTrait2<S>();
-  b &= TestTrait3<int>();
-  b &= TestTrait3<S>();
-  b &= TestTrait4<int>();
-  b &= TestTrait4<S>();
-  return b;
-}
-
-int Test1(const char* ptr) {
-  int sum = 0;
-  sum += sizeof(LEN);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(K)'
-  sum += sizeof(LEN + 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(K)'
-  sum += sizeof(sum, LEN);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(..., ...)'
-  sum += sizeof(AsBool());
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-  sum += sizeof(AsInt());
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-  sum += sizeof(AsEnum());
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-  sum += sizeof(AsEnumClass());
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-  sum += sizeof(M{}.AsInt());
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-  sum += sizeof(M{}.AsEnum());
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
-  sum += sizeof(sizeof(X));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
-  sum += sizeof(LEN + sizeof(X));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
-  sum += sizeof(LEN + LEN + sizeof(X));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
-  sum += sizeof(LEN + (LEN + sizeof(X)));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
-  sum += sizeof(LEN + -sizeof(X));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
-  sum += sizeof(LEN + - + -sizeof(X));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
-  sum += sizeof(char) / sizeof(char);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'
-  sum += sizeof(A) / sizeof(S);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
-  sum += sizeof(char) / sizeof(int);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
-  sum += sizeof(char) / sizeof(A);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
-  sum += sizeof(B[0]) / sizeof(A);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
-  sum += sizeof(ptr) / sizeof(char);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
-  sum += sizeof(ptr) / sizeof(ptr[0]);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
-  sum += sizeof(ptr) / sizeof(char*);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'
-  sum += sizeof(ptr) / sizeof(void*);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'
-  sum += sizeof(ptr) / sizeof(const void volatile*);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'
-  sum += sizeof(ptr) / sizeof(char);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
-  sum += sizeof(ptr) / sizeof(ptr[0]);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
-  sum += sizeof(int) * sizeof(char);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
-  sum += sizeof(ptr) * sizeof(ptr[0]);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
-  sum += sizeof(int) * (2 * sizeof(char));
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
-  sum += (2 * sizeof(char)) * sizeof(int);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
-  if (sizeof(A) < 0x100000) sum += 42;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: suspicious comparison of 'sizeof(expr)' to a constant
-  if (sizeof(A) <= 0xFFFFFFFEU) sum += 42;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: suspicious comparison of 'sizeof(expr)' to a constant
-  return sum;
-}
-
-typedef char MyChar;
-typedef const MyChar MyConstChar;
-
-int CE0 = sizeof sizeof(char);
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: suspicious usage of 'sizeof(sizeof(...))'
-int CE1 = sizeof +sizeof(char);
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: suspicious usage of 'sizeof(sizeof(...))'
-int CE2 = sizeof sizeof(const char*);
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: suspicious usage of 'sizeof(sizeof(...))'
-int CE3 = sizeof sizeof(const volatile char* const*);
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: suspicious usage of 'sizeof(sizeof(...))'
-int CE4 = sizeof sizeof(MyConstChar);
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: suspicious usage of 'sizeof(sizeof(...))'
-
-int Test2(MyConstChar* A) {
-  int sum = 0;
-  sum += sizeof(MyConstChar) / sizeof(char);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'
-  sum += sizeof(MyConstChar) / sizeof(MyChar);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'
-  sum += sizeof(A[0]) / sizeof(char);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'
-  return sum;
-}
-
-template <int T>
-int Foo() { int A[T]; return sizeof(T); }
-// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: suspicious usage of 'sizeof(K)'
-template <typename T>
-int Bar() { T A[5]; return sizeof(A[0]) / sizeof(T); }
-// CHECK-MESSAGES: :[[@LINE-1]]:28: warning: suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'
-int Test3() { return Foo<42>() + Bar<char>(); }
-
-static const char* kABC = "abc";
-static const wchar_t* kDEF = L"def";
-int Test4(const char A[10]) {
-  int sum = 0;
-  sum += sizeof(kABC);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(char*)'
-  sum += sizeof(kDEF);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(char*)'
-  return sum;
-}
-
-int Test5() {
-  typedef int Array10[10];
-
-  struct MyStruct {
-    Array10 arr;
-    Array10* ptr;
-  };
-  typedef const MyStruct TMyStruct;
-  typedef const MyStruct *PMyStruct;
-  typedef TMyStruct *PMyStruct2;
-
-  static TMyStruct kGlocalMyStruct = {};
-  static TMyStruct volatile * kGlocalMyStructPtr = &kGlocalMyStruct;
-
-  MyStruct S;
-  PMyStruct PS;
-  PMyStruct2 PS2;
-  Array10 A10;
-
-  int sum = 0;
-  sum += sizeof(&S.arr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(&kGlocalMyStruct.arr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(&kGlocalMyStructPtr->arr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(S.arr + 0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(+ S.arr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof((int*)S.arr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-
-  sum += sizeof(S.ptr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(kGlocalMyStruct.ptr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(kGlocalMyStructPtr->ptr);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-
-  sum += sizeof(&kGlocalMyStruct);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(&S);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(MyStruct*);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(PMyStruct);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(PS);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(PS2);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-  sum += sizeof(&A10);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate
-
-  return sum;
-}
-
-int Test6() {
-  int sum = 0;
-
-  struct S A = AsStruct(), B = AsStruct();
-  struct S *P = &A, *Q = &B;
-  sum += sizeof(struct S) == P - Q;
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += 5 * sizeof(S) != P - Q;
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += sizeof(S) < P - Q;
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += 5 * sizeof(S) <= P - Q;
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += 5 * sizeof(*P) >= P - Q;
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += Q - P > 3 * sizeof(*P);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += sizeof(S) + (P - Q);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += 5 * sizeof(S) - (P - Q);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += (P - Q) / sizeof(S);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-  sum += (P - Q) / sizeof(*Q);
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic
-
-  return sum;
-}
-
-int ValidExpressions() {
-  int A[] = {1, 2, 3, 4};
-  static const char str[] = "hello";
-  static const char* ptr[] { "aaa", "bbb", "ccc" };
-  int sum = 0;
-  if (sizeof(A) < 10)
-    sum += sizeof(A);
-  sum += sizeof(int);
-  sum += sizeof(AsStruct());
-  sum += sizeof(M{}.AsStruct());
-  sum += sizeof(A[sizeof(A) / sizeof(int)]);
-  sum += sizeof(&A[sizeof(A) / sizeof(int)]);
-  sum += sizeof(sizeof(0));  // Special case: sizeof size_t.
-  sum += sizeof(void*);
-  sum += sizeof(void const *);
-  sum += sizeof(void const *) / 4;
-  sum += sizeof(str);
-  sum += sizeof(str) / sizeof(char);
-  sum += sizeof(str) / sizeof(str[0]);
-  sum += sizeof(ptr) / sizeof(ptr[0]);
-  sum += sizeof(ptr) / sizeof(*(ptr));
-  return sum;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-string-constructor.cpp (removed)
@@ -1,75 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-string-constructor %t
-
-namespace std {
-template <typename T>
-class allocator {};
-template <typename T>
-class char_traits {};
-template <typename C, typename T = std::char_traits<C>, typename A = std::allocator<C> >
-struct basic_string {
-  basic_string();
-  basic_string(const C*, unsigned int size);
-  basic_string(const C *, const A &allocator = A());
-  basic_string(unsigned int size, C c);
-};
-typedef basic_string<char> string;
-typedef basic_string<wchar_t> wstring;
-}
-
-const char* kText = "";
-const char kText2[] = "";
-extern const char kText3[];
-
-void Test() {
-  std::string str('x', 4);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: string constructor parameters are probably swapped; expecting string(count, character) [bugprone-string-constructor]
-  // CHECK-FIXES: std::string str(4, 'x');
-  std::wstring wstr(L'x', 4);
-  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: string constructor parameters are probably swapped
-  // CHECK-FIXES: std::wstring wstr(4, L'x');
-  std::string s0(0, 'x');
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: constructor creating an empty string
-  std::string s1(-4, 'x');
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: negative value used as length parameter
-  std::string s2(0x1000000, 'x');
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: suspicious large length parameter
-
-  std::string q0("test", 0);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: constructor creating an empty string
-  std::string q1(kText, -4);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: negative value used as length parameter
-  std::string q2("test", 200);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger than string literal size
-  std::string q3(kText, 200);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger than string literal size
-  std::string q4(kText2, 200);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger than string literal size
-  std::string q5(kText3,  0x1000000);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: suspicious large length parameter
-  std::string q6(nullptr);
-  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: constructing string from nullptr is undefined behaviour
-  std::string q7 = 0;
-  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: constructing string from nullptr is undefined behaviour
-}
-
-std::string StringFromZero() {
-  return 0;
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: constructing string from nullptr is undefined behaviour
-}
-
-void Valid() {
-  std::string empty();
-  std::string str(4, 'x');
-  std::wstring wstr(4, L'x');
-  std::string s1("test", 4);
-  std::string s2("test", 3);
-  std::string s3("test");
-}
-
-namespace instantiation_dependent_exprs {
-template<typename T>
-struct S {
-  bool x;
-  std::string f() { return x ? "a" : "b"; }
-};
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-string-integer-assignment.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-string-integer-assignment.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-string-integer-assignment.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-string-integer-assignment.cpp (removed)
@@ -1,109 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-string-integer-assignment %t
-
-namespace std {
-template<typename T>
-struct basic_string {
-  basic_string& operator=(T);
-  basic_string& operator=(basic_string);
-  basic_string& operator+=(T);
-  basic_string& operator+=(basic_string);
-  const T &operator[](int i) const;
-  T &operator[](int i);
-};
-
-typedef basic_string<char> string;
-typedef basic_string<wchar_t> wstring;
-
-int tolower(int i);
-int toupper(int i);
-}
-
-int tolower(int i);
-int toupper(int i);
-
-typedef int MyArcaneChar;
-
-constexpr char kCharConstant = 'a';
-
-int main() {
-  std::string s;
-  std::wstring ws;
-  int x = 5;
-  const char c = 'c';
-
-  s = 6;
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: an integer is interpreted as a character code when assigning {{.*}} [bugprone-string-integer-assignment]
-// CHECK-FIXES: {{^}}  s = '6';{{$}}
-  s = 66;
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: an integer is interpreted as a chara
-// CHECK-FIXES: {{^}}  s = "66";{{$}}
-  s = x;
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: an integer is interpreted as a chara
-// CHECK-FIXES: {{^}}  s = std::to_string(x);{{$}}
-  s = 'c';
-  s = static_cast<char>(6);
-
-// +=
-  ws += 6;
-// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: an integer is interpreted as a chara
-// CHECK-FIXES: {{^}}  ws += L'6';{{$}}
-  ws += 66;
-// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: an integer is interpreted as a chara
-// CHECK-FIXES: {{^}}  ws += L"66";{{$}}
-  ws += x;
-// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: an integer is interpreted as a chara
-// CHECK-FIXES: {{^}}  ws += std::to_wstring(x);{{$}}
-  ws += L'c';
-  ws += (wchar_t)6;
-
-  std::basic_string<MyArcaneChar> as;
-  as = 6;
-  as = static_cast<MyArcaneChar>(6);
-  as = 'a';
-
-  s += toupper(x);
-  s += tolower(x);
-  s += (std::tolower(x));
-
-  s += c & s[1];
-  s += c ^ s[1];
-  s += c | s[1];
-
-  s[x] += 1;
-  s += s[x];
-  as += as[x];
-
-  // Likely character expressions.
-  s += x & 0xff;
-  s += 0xff & x;
-  s += x % 26;
-  s += 26 % x;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: an integer is interpreted as a chara
-  // CHECK-FIXES: {{^}}  s += std::to_string(26 % x);{{$}}
-  s += c | 0x80;
-  s += c | 0x8000;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: an integer is interpreted as a chara
-  // CHECK-FIXES: {{^}}  s += std::to_string(c | 0x8000);{{$}}
-  as += c | 0x8000;
-
-  s += 'a' + (x % 26);
-  s += kCharConstant + (x % 26);
-  s += 'a' + (s[x] & 0xf);
-  s += (x % 10) + 'b';
-
-  s += x > 255 ? c : x;
-  s += x > 255 ? 12 : x;
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: an integer is interpreted as a chara
-  // CHECK-FIXES: {{^}}  s += std::to_string(x > 255 ? 12 : x);{{$}}
-}
-
-namespace instantiation_dependent_exprs {
-template<typename T>
-struct S {
-  static constexpr T t = 0x8000;
-  std::string s;
-  void f(char c) { s += c | static_cast<int>(t); }
-};
-
-template S<int>;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-string-literal-with-embedded-nul.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-string-literal-with-embedded-nul.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-string-literal-with-embedded-nul.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-string-literal-with-embedded-nul.cpp (removed)
@@ -1,85 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-string-literal-with-embedded-nul %t
-
-namespace std {
-template <typename T>
-class allocator {};
-template <typename T>
-class char_traits {};
-template <typename C, typename T, typename A>
-struct basic_string {
-  typedef basic_string<C, T, A> _Type;
-  basic_string();
-  basic_string(const C *p, const A &a = A());
-
-  _Type& operator+=(const C* s);
-  _Type& operator=(const C* s);
-};
-
-typedef basic_string<char, std::char_traits<char>, std::allocator<char>> string;
-typedef basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> wstring;
-}
-
-bool operator==(const std::string&, const char*);
-bool operator==(const char*, const std::string&);
-
-
-const char Valid[] = "This is valid \x12.";
-const char Strange[] = "This is strange \0x12 and must be fixed";
-// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: suspicious embedded NUL character [bugprone-string-literal-with-embedded-nul]
-
-const char textA[] = "\0x01\0x02\0x03\0x04";
-// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: suspicious embedded NUL character
-const wchar_t textW[] = L"\0x01\0x02\0x03\0x04";
-// CHECK-MESSAGES: :[[@LINE-1]]:25: warning: suspicious embedded NUL character
-
-const char A[] = "\0";
-const char B[] = "\0x";
-const char C[] = "\0x1";
-const char D[] = "\0x11";
-// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: suspicious embedded NUL character
-
-const wchar_t E[] = L"\0";
-const wchar_t F[] = L"\0x";
-const wchar_t G[] = L"\0x1";
-const wchar_t H[] = L"\0x11";
-// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: suspicious embedded NUL character
-
-const char I[] = "\000\000\000\000";
-const char J[] = "\0\0\0\0\0\0";
-const char K[] = "";
-
-const char L[] = "\0x12" "\0x12" "\0x12" "\0x12";
-// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: suspicious embedded NUL character
-
-void TestA() {
-  std::string str1 = "abc\0def";
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: truncated string literal
-  std::string str2 = "\0";
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: truncated string literal
-  std::string str3("\0");
-  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: truncated string literal
-  std::string str4{"\x00\x01\x02\x03"};
-  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: truncated string literal
-
-  std::string str;
-  str += "abc\0def";
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: truncated string literal
-  str = "abc\0def";
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: truncated string literal
-
-  if (str == "abc\0def") return;
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: truncated string literal
-  if ("abc\0def" == str) return;
-  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: truncated string literal
-}
-
-void TestW() {
-  std::wstring str1 = L"abc\0def";
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: truncated string literal
-  std::wstring str2 = L"\0";
-  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: truncated string literal
-  std::wstring str3(L"\0");
-  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: truncated string literal
-  std::wstring str4{L"\x00\x01\x02\x03"};
-  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: truncated string literal
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp (removed)
@@ -1,98 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: 1}]}" --
-
-enum A {
-  A = 1,
-  B = 2,
-  C = 4,
-  D = 8,
-  E = 16,
-  F = 32,
-  G = 63
-};
-
-// CHECK-NOTES: :[[@LINE+2]]:1: warning: enum type seems like a bitmask (contains mostly power-of-2 literals) but a literal is not power-of-2
-// CHECK-NOTES: :76:7: note: used here as a bitmask
-enum X {
-  X = 8,
-  Y = 16,
-  Z = 4,
-  ZZ = 3
-  // CHECK-NOTES: :[[@LINE-1]]:3: warning: enum type seems like a bitmask (contains mostly power-of-2 literals), but this literal is not a power-of-2 [bugprone-suspicious-enum-usage]
-// CHECK-NOTES: :70:13: note: used here as a bitmask
-};
-// CHECK-NOTES: :[[@LINE+2]]:1: warning: enum type seems like a bitmask (contains mostly power-of-2 literals) but some literals are not power-of-2
-// CHECK-NOTES: :73:8: note: used here as a bitmask
-enum PP {
-  P = 2,
-  Q = 3,
-  // CHECK-NOTES: :[[@LINE-1]]:3: warning: enum type seems like a bitmask (contains mostly power-of-2 literals), but this literal is not a power-of-2
-  // CHECK-NOTES: :65:11: note: used here as a bitmask
-  R = 4,
-  S = 8,
-  T = 16,
-  U = 31
-};
-
-enum {
-  H,
-  I,
-  J,
-  K,
-  L
-};
-
-enum Days {
-  Monday,
-  Tuesday,
-  Wednesday,
-  Thursday,
-  Friday,
-  Saturday,
-  Sunday
-};
-
-Days bestDay() {
-  return Friday;
-}
-
-int trigger() {
-  if (bestDay() | A)
-    return 1;
-  // CHECK-NOTES: :[[@LINE-2]]:17: warning: enum values are from different enum types
-  if (I | Y)
-    return 1;
-  // CHECK-NOTES: :[[@LINE-2]]:9: warning: enum values are from different enum types
-  if (P + Q == R)
-    return 1;
-  else if ((S | R) == T)
-    return 1;
-  else
-    int k = ZZ | Z;
-  unsigned p = R;
-  PP pp = Q;
-  p |= pp;
-  
-  enum X x = Z;
-  p = x | Z;
-  return 0;
-}
-
-int dont_trigger() {
-  int a = 1, b = 5;
-  int c = a + b;
-  int d = c | H, e = b * a;
-  a = B | C;
-  b = X | Z;
-
-  unsigned bitflag;
-  enum A aa = B;
-  bitflag = aa | C;
-
-  if (Tuesday != Monday + 1 ||
-      Friday - Thursday != 1 ||
-      Sunday + Wednesday == (Sunday | Wednesday))
-    return 1;
-  if (H + I + L == 42)
-    return 1;
-  return 42;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp (removed)
@@ -1,96 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: 0}]}" --
-
-enum Empty {
-};
-
-enum A {
-  A = 1,
-  B = 2,
-  C = 4,
-  D = 8,
-  E = 16,
-  F = 32,
-  G = 63
-};
-
-enum X {
-  X = 8,
-  Y = 16,
-  Z = 4
-};
-
-enum {
-  P = 2,
-  Q = 3,
-  R = 4,
-  S = 8,
-  T = 16
-};
-
-enum {
-  H,
-  I,
-  J,
-  K,
-  L
-};
-
-enum Days {
-  Monday,
-  Tuesday,
-  Wednesday,
-  Thursday,
-  Friday,
-  Saturday,
-  Sunday
-};
-
-Days bestDay() {
-  return Friday;
-}
-
-int trigger() {
-  Empty EmptyVal;
-  int emptytest = EmptyVal | B;
-  if (bestDay() | A)
-    return 1;
-  // CHECK-NOTES: :[[@LINE-2]]:17: warning: enum values are from different enum types
-  if (I | Y)
-    return 1;
-  // CHECK-NOTES: :[[@LINE-2]]:9: warning: enum values are from different enum types
-}
-
-int dont_trigger() {
-  unsigned p;
-  p = Q | P;
-
-  if (A + G == E)
-    return 1;
-  else if ((Q | R) == T)
-    return 1;
-  else
-    int k = T | Q;
-
-  Empty EmptyVal;
-  int emptytest = EmptyVal | B;
-
-  int a = 1, b = 5;
-  int c = a + b;
-  int d = c | H, e = b * a;
-  a = B | C;
-  b = X | Z;
-  
-  if (Tuesday != Monday + 1 ||
-      Friday - Thursday != 1 ||
-      Sunday + Wednesday == (Sunday | Wednesday))
-    return 1;
-  if (H + I + L == 42)
-    return 1;
-  return 42;
-}
-
-namespace PR34400 {
-enum { E1 = 0 };
-enum { E2 = -1 };
-enum { l = E1 | E2 };
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-memset-usage.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-memset-usage.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-memset-usage.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-memset-usage.cpp (removed)
@@ -1,77 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-memset-usage %t
-
-void *memset(void *, int, __SIZE_TYPE__);
-
-namespace std {
-  using ::memset;
-}
-
-template <typename T>
-void mtempl(int *ptr) {
-  memset(ptr, '0', sizeof(T));
-// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: memset fill value is char '0', potentially mistaken for int 0 [bugprone-suspicious-memset-usage]
-// CHECK-FIXES: memset(ptr, 0, sizeof(T));
-  memset(ptr, 256, sizeof(T));
-// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: memset fill value is out of unsigned character range, gets truncated [bugprone-suspicious-memset-usage]
-  memset(0, sizeof(T), 0);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset of size zero, potentially swapped arguments [bugprone-suspicious-memset-usage]
-// CHECK-FIXES: memset(0, 0, sizeof(T));
-  memset(0, sizeof(int), 0);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset of size zero, potentially swapped arguments [bugprone-suspicious-memset-usage]
-// CHECK-FIXES: memset(0, 0, sizeof(int));
-}
-
-void foo(int xsize, int ysize) {
-  int i[5] = {1, 2, 3, 4, 5};
-  char ca[3] = {'a', 'b', 'c'};
-  int *p = i;
-  int l = 5;
-  char z = '1';
-  char *c = &z;
-  int v = 0;
-
-  memset(p, '0', l);
-// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: memset fill value is char '0', potentially mistaken for int 0 [bugprone-suspicious-memset-usage]
-// CHECK-FIXES: memset(p, 0, l);
-
-  memset(p, 0xabcd, l);
-// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: memset fill value is out of unsigned character range, gets truncated [bugprone-suspicious-memset-usage]
-
-  memset(p, sizeof(int), 0);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset of size zero, potentially swapped arguments [bugprone-suspicious-memset-usage]
-// CHECK-FIXES: memset(p, 0, sizeof(int));
-  std::memset(p, sizeof(int), 0x00);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset of size zero, potentially swapped arguments [bugprone-suspicious-memset-usage]
-// CHECK-FIXES: std::memset(p, 0x00, sizeof(int));
-
-#define M_CHAR_ZERO memset(p, '0', l);
-  M_CHAR_ZERO
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset fill value is char '0', potentially mistaken for int 0 [bugprone-suspicious-memset-usage]
-
-#define M_OUTSIDE_RANGE memset(p, 0xabcd, l);
-  M_OUTSIDE_RANGE
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset fill value is out of unsigned character range, gets truncated [bugprone-suspicious-memset-usage]
-
-#define M_ZERO_LENGTH memset(p, sizeof(int), 0);
-  M_ZERO_LENGTH
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: memset of size zero, potentially swapped arguments [bugprone-suspicious-memset-usage]
-
-  memset(p, '2', l);
-  memset(p, 0, l);
-  memset(c, '0', 1);
-  memset(ca, '0', sizeof(ca));
-
-  memset(p, 0x00, l);
-  mtempl<int>(p);
-
-  memset(p, sizeof(int), v + 1);
-  memset(p, 0xcd, 1);
-
-  // Don't warn when the fill char and the length are both known to be
-  // zero.  No bug is possible.
-  memset(p, 0, v);
-
-  // -1 is clearly not a length by virtue of being negative, so no warning
-  // despite v == 0.
-  memset(p, -1, v);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-missing-comma.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-missing-comma.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-missing-comma.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-missing-comma.cpp (removed)
@@ -1,82 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-missing-comma %t
-
-const char* Cartoons[] = {
-  "Bugs Bunny",
-  "Homer Simpson",
-  "Mickey Mouse",
-  "Bart Simpson",
-  "Charlie Brown"  // There is a missing comma here.
-  "Fred Flintstone",
-  "Popeye",
-};
-// CHECK-MESSAGES: :[[@LINE-4]]:3: warning: suspicious string literal, probably missing a comma [bugprone-suspicious-missing-comma]
-
-const wchar_t* Colors[] = {
-  L"Red", L"Yellow", L"Blue", L"Green", L"Purple", L"Rose", L"White", L"Black"
-};
-
-// The following array should not trigger any warnings. There is more than 5
-// elements, but they are all concatenated string literals.
-const char* HttpCommands[] = {
-  "GET / HTTP/1.0\r\n"
-  "\r\n",
-
-  "GET /index.html HTTP/1.0\r\n"
-  "\r\n",
-
-  "GET /favicon.ico HTTP/1.0\r\n"
-  "header: dummy"
-  "\r\n",
-
-  "GET /index.html-en HTTP/1.0\r\n"
-  "\r\n",
-
-  "GET /index.html-fr HTTP/1.0\r\n"
-  "\r\n",
-
-  "GET /index.html-es HTTP/1.0\r\n"
-  "\r\n",
-};
-
-// This array is too small to trigger a warning.
-const char* SmallArray[] = {
-  "a" "b", "c"
-};
-
-// Parentheses should be enough to avoid warnings.
-const char* ParentheseArray[] = {
-  ("a" "b"), "c",
-  ("d"
-   "e"
-   "f"),
-  "g", "h", "i", "j", "k", "l"
-};
-
-// Indentation should be enough to avoid warnings.
-const char* CorrectlyIndentedArray[] = {
-  "This is a long message "
-      "which is spanning over multiple lines."
-      "And this should be fine.",
-  "a", "b", "c", "d", "e", "f",
-  "g", "h", "i", "j", "k", "l"
-};
-
-const char* IncorrectlyIndentedArray[] = {
-  "This is a long message "
-  "which is spanning over multiple lines."
-      "And this should be fine.",
-  "a", "b", "c", "d", "e", "f",
-  "g", "h", "i", "j", "k", "l"
-};
-// CHECK-MESSAGES: :[[@LINE-6]]:3: warning: suspicious string literal, probably missing a comma [bugprone-suspicious-missing-comma]
-
-const char* TooManyConcatenatedTokensArray[] = {
-  "Dummy line",
-  "Dummy line",
-  "a" "b" "c" "d" "e" "f",
-  "g" "h" "i" "j" "k" "l",
-  "Dummy line",
-  "Dummy line",
-  "Dummy line",
-  "Dummy line",
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon-fail.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon-fail.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon-fail.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon-fail.cpp (removed)
@@ -1,28 +0,0 @@
-// RUN: not clang-tidy %s \
-// RUN:     -checks="-*,bugprone-suspicious-semicolon" -- -DERROR 2>&1 \
-// RUN:   | FileCheck %s -check-prefix=CHECK-ERROR \
-// RUN:       -implicit-check-not="{{warning|error}}:"
-// RUN: not clang-tidy %s \
-// RUN:     -checks="-*,bugprone-suspicious-semicolon,clang-diagnostic*" \
-// RUN:    -- -DWERROR -Wno-everything -Werror=unused-variable 2>&1 \
-// RUN:   | FileCheck %s -check-prefix=CHECK-WERROR \
-// RUN:       -implicit-check-not="{{warning|error}}:"
-
-// Note: This test verifies that, the checker does not emit any warning for
-//       files that do not compile.
-
-bool g();
-
-void f() {
-  if (g());
-  // CHECK-WERROR: :[[@LINE-1]]:11: warning: potentially unintended semicolon [bugprone-suspicious-semicolon]
-#if ERROR
-  int a
-  // CHECK-ERROR: :[[@LINE-1]]:8: error: expected ';' at end of declaration [clang-diagnostic-error]
-#elif WERROR
-  int a;
-  // CHECK-WERROR: :[[@LINE-1]]:7: error: unused variable 'a' [clang-diagnostic-unused-variable]
-#else
-#error "One of ERROR or WERROR should be defined.
-#endif
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-semicolon.cpp (removed)
@@ -1,117 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-semicolon %t
-
-int x = 5;
-
-void nop();
-
-void correct1()
-{
-	if(x < 5) nop();
-}
-
-void correct2()
-{
-	if(x == 5)
-		nop();
-}
-
-void correct3()
-{
-	if(x > 5)
-	{
-		nop();
-	}
-}
-
-void fail1()
-{
-  if(x > 5); nop();
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: potentially unintended semicolon [bugprone-suspicious-semicolon]
-  // CHECK-FIXES: if(x > 5) nop();
-}
-
-void fail2()
-{
-	if(x == 5);
-		nop();
-  // CHECK-MESSAGES: :[[@LINE-2]]:12: warning: potentially unintended semicolon [bugprone-suspicious-semicolon]
-  // CHECK-FIXES: if(x == 5){{$}}
-}
-
-void fail3()
-{
-	if(x < 5);
-	{
-		nop();
-	}
-  // CHECK-MESSAGES: :[[@LINE-4]]:11: warning: potentially unintended semicolon
-  // CHECK-FIXES: if(x < 5){{$}}
-}
-
-void correct4()
-{
-  while(x % 5 == 1);
-  nop();
-}
-
-void correct5()
-{
-	for(int i = 0; i < x; ++i)
-		;
-}
-
-void fail4()
-{
-	for(int i = 0; i < x; ++i);
-		nop();
-  // CHECK-MESSAGES: :[[@LINE-2]]:28: warning: potentially unintended semicolon
-  // CHECK-FIXES: for(int i = 0; i < x; ++i){{$}}
-}
-
-void fail5()
-{
-	if(x % 5 == 1);
-	  nop();
-  // CHECK-MESSAGES: :[[@LINE-2]]:16: warning: potentially unintended semicolon
-  // CHECK-FIXES: if(x % 5 == 1){{$}}
-}
-
-void fail6() {
-  int a = 0;
-  if (a != 0) {
-  } else if (a != 1);
-    a = 2;
-  // CHECK-MESSAGES: :[[@LINE-2]]:21: warning: potentially unintended semicolon
-  // CHECK-FIXES: } else if (a != 1){{$}}
-}
-
-void fail7() {
-  if (true)
-    ;
-  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: potentially unintended semicolon
-}
-
-void correct6()
-{
-	do; while(false);
-}
-
-int correct7()
-{
-  int t_num = 0;
-  char c = 'b';
-  char *s = "a";
-  if (s == "(" || s != "'" || c == '"') {
-    t_num += 3;
-    return (c == ')' && c == '\'');
-  }
-
-  return 0;
-}
-
-void correct8() {
-  if (true)
-    ;
-  else {
-  }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.c (removed)
@@ -1,79 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-string-compare %t -- \
-// RUN: -config='{CheckOptions: \
-// RUN:  [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: 1}, \
-// RUN:   {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: 1}]}' \
-// RUN: -- -std=c99
-
-static const char A[] = "abc";
-
-int strcmp(const char *, const char *);
-
-int test_warning_patterns() {
-  if (strcmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is called without explicitly comparing result [bugprone-suspicious-string-compare]
-  // CHECK-FIXES: if (strcmp(A, "a") != 0)
-
-  if (strcmp(A, "a") != 0 ||
-      strcmp(A, "b"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is called without explicitly comparing result
-  // CHECK-FIXES: strcmp(A, "b") != 0)
-
-  if (strcmp(A, "a") == 1)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") == -1)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") < '0')
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") < 0.)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' has suspicious implicit cast
-
-  if (!strcmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:8: warning: function 'strcmp' is compared using logical not operator
-  // CHECK-FIXES: if (strcmp(A, "a") == 0)
-}
-
-void test_structure_patterns() {
-  if (strcmp(A, "a")) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: function 'strcmp' is called without explicitly comparing result
-  // CHECK-FIXES: if (strcmp(A, "a") != 0) {}
-
-  while (strcmp(A, "a")) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: function 'strcmp' is called without explicitly comparing result
-  // CHECK-FIXES: while (strcmp(A, "a") != 0) {}
-
-  for (;strcmp(A, "a");) {}
-  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: function 'strcmp' is called without explicitly comparing result
-  // CHECK-FIXES: for (;strcmp(A, "a") != 0;) {}
-}
-
-int test_valid_patterns() {
-  // The following cases are valid.
-  if (strcmp(A, "a") < 0) return 0;
-  if (strcmp(A, "a") == 0) return 0;
-  if (strcmp(A, "a") <= 0) return 0;
-  if (strcmp(A, "a") == strcmp(A, "b")) return 0;
-  return 1;
-}
-
-int wrapper(const char* a, const char* b) {
-  return strcmp(a, b);
-}
-
-int assignment_wrapper(const char* a, const char* b) {
-  int cmp = strcmp(a, b);
-  return cmp;
-}
-
-int condexpr_wrapper(const char* a, const char* b) {
-  return (a < b) ? strcmp(a, b) : strcmp(b, a);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-string-compare.cpp (removed)
@@ -1,337 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-suspicious-string-compare %t -- \
-// RUN: -config='{CheckOptions: \
-// RUN:  [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: 1}, \
-// RUN:   {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: 1}]}' \
-// RUN: --
-
-typedef __SIZE_TYPE__ size;
-
-struct locale_t {
-  void* dummy;
-} locale;
-
-static const char A[] = "abc";
-static const unsigned char U[] = "abc";
-static const unsigned char V[] = "xyz";
-static const wchar_t W[] = L"abc";
-
-int strlen(const char *);
-
-int memcmp(const void *, const void *, size);
-int wmemcmp(const wchar_t *, const wchar_t *, size);
-int memicmp(const void *, const void *, size);
-int _memicmp(const void *, const void *, size);
-int _memicmp_l(const void *, const void *, size, locale_t);
-
-int strcmp(const char *, const char *);
-int strncmp(const char *, const char *, size);
-int strcasecmp(const char *, const char *);
-int strncasecmp(const char *, const char *, size);
-int stricmp(const char *, const char *);
-int strcmpi(const char *, const char *);
-int strnicmp(const char *, const char *, size);
-int _stricmp(const char *, const char * );
-int _strnicmp(const char *, const char *, size);
-int _stricmp_l(const char *, const char *, locale_t);
-int _strnicmp_l(const char *, const char *, size, locale_t);
-
-int wcscmp(const wchar_t *, const wchar_t *);
-int wcsncmp(const wchar_t *, const wchar_t *, size);
-int wcscasecmp(const wchar_t *, const wchar_t *);
-int wcsicmp(const wchar_t *, const wchar_t *);
-int wcsnicmp(const wchar_t *, const wchar_t *, size);
-int _wcsicmp(const wchar_t *, const wchar_t *);
-int _wcsnicmp(const wchar_t *, const wchar_t *, size);
-int _wcsicmp_l(const wchar_t *, const wchar_t *, locale_t);
-int _wcsnicmp_l(const wchar_t *, const wchar_t *, size, locale_t);
-
-int _mbscmp(const unsigned char *, const unsigned char *);
-int _mbsncmp(const unsigned char *, const unsigned char *, size);
-int _mbsnbcmp(const unsigned char *, const unsigned char *, size);
-int _mbsnbicmp(const unsigned char *, const unsigned char *, size);
-int _mbsicmp(const unsigned char *, const unsigned char *);
-int _mbsnicmp(const unsigned char *, const unsigned char *, size);
-int _mbscmp_l(const unsigned char *, const unsigned char *, locale_t);
-int _mbsncmp_l(const unsigned char *, const unsigned char *, size, locale_t);
-int _mbsicmp_l(const unsigned char *, const unsigned char *, locale_t);
-int _mbsnicmp_l(const unsigned char *, const unsigned char *, size, locale_t);
-int _mbsnbcmp_l(const unsigned char *, const unsigned char *, size, locale_t);
-int _mbsnbicmp_l(const unsigned char *, const unsigned char *, size, locale_t);
-
-int test_warning_patterns() {
-  if (strcmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is called without explicitly comparing result [bugprone-suspicious-string-compare]
-  // CHECK-FIXES: if (strcmp(A, "a") != 0)
-
-  if (strcmp(A, "a") == 0 ||
-      strcmp(A, "b"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is called without explicitly comparing result
-  // CHECK-FIXES: strcmp(A, "b") != 0)
-
-  if (strcmp(A, "a") == 1)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") == -1)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") == true)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") < '0')
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (strcmp(A, "a") < 0.)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' has suspicious implicit cast
-}
-
-int test_valid_patterns() {
-  // The following cases are valid.
-  if (strcmp(A, "a") < 0)
-    return 0;
-  if (strcmp(A, "a") == 0)
-    return 0;
-  if (strcmp(A, "a") <= 0)
-    return 0;
-
-  if (wcscmp(W, L"a") < 0)
-    return 0;
-  if (wcscmp(W, L"a") == 0)
-    return 0;
-  if (wcscmp(W, L"a") <= 0)
-    return 0;
-
-  return 1;
-}
-
-int test_implicit_compare_with_functions() {
-
-  if (memcmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'memcmp' is called without explicitly comparing result
-  // CHECK-FIXES: memcmp(A, "a", 1) != 0)
-
-  if (wmemcmp(W, L"a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'wmemcmp' is called without explicitly comparing result
-  // CHECK-FIXES: wmemcmp(W, L"a", 1) != 0)
-
-  if (memicmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'memicmp' is called without explicitly comparing result
-  // CHECK-FIXES: memicmp(A, "a", 1) != 0)
-
-  if (_memicmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_memicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _memicmp(A, "a", 1) != 0)
-
-  if (_memicmp_l(A, "a", 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_memicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _memicmp_l(A, "a", 1, locale) != 0)
-
-  if (strcmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is called without explicitly comparing result
-  // CHECK-FIXES: strcmp(A, "a") != 0)
-
-  if (strncmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strncmp' is called without explicitly comparing result
-  // CHECK-FIXES: strncmp(A, "a", 1) != 0)
-
-  if (strcasecmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcasecmp' is called without explicitly comparing result
-  // CHECK-FIXES: strcasecmp(A, "a") != 0)
-
-  if (strncasecmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strncasecmp' is called without explicitly comparing result
-  // CHECK-FIXES: strncasecmp(A, "a", 1) != 0)
-
-  if (stricmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'stricmp' is called without explicitly comparing result
-  // CHECK-FIXES: stricmp(A, "a") != 0)
-
-  if (strcmpi(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmpi' is called without explicitly comparing result
-  // CHECK-FIXES: strcmpi(A, "a") != 0)
-
-  if (_stricmp(A, "a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_stricmp' is called without explicitly comparing result
-  // CHECK-FIXES: _stricmp(A, "a") != 0)
-
-  if (strnicmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strnicmp' is called without explicitly comparing result
-  // CHECK-FIXES: strnicmp(A, "a", 1) != 0)
-
-  if (_strnicmp(A, "a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_strnicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _strnicmp(A, "a", 1) != 0)
-
-  if (_stricmp_l(A, "a", locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_stricmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _stricmp_l(A, "a", locale) != 0)
-
-  if (_strnicmp_l(A, "a", 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_strnicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _strnicmp_l(A, "a", 1, locale) != 0)
-
-  if (wcscmp(W, L"a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'wcscmp' is called without explicitly comparing result
-  // CHECK-FIXES: wcscmp(W, L"a") != 0)
-
-  if (wcsncmp(W, L"a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'wcsncmp' is called without explicitly comparing result
-  // CHECK-FIXES: wcsncmp(W, L"a", 1) != 0)
-
-  if (wcscasecmp(W, L"a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'wcscasecmp' is called without explicitly comparing result
-  // CHECK-FIXES: wcscasecmp(W, L"a") != 0)
-
-  if (wcsicmp(W, L"a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'wcsicmp' is called without explicitly comparing result
-  // CHECK-FIXES: wcsicmp(W, L"a") != 0)
-
-  if (_wcsicmp(W, L"a"))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_wcsicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _wcsicmp(W, L"a") != 0)
-
-  if (_wcsicmp_l(W, L"a", locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_wcsicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _wcsicmp_l(W, L"a", locale) != 0)
-
-  if (wcsnicmp(W, L"a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'wcsnicmp' is called without explicitly comparing result
-  // CHECK-FIXES: wcsnicmp(W, L"a", 1) != 0)
-
-  if (_wcsnicmp(W, L"a", 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_wcsnicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _wcsnicmp(W, L"a", 1) != 0)
-
-  if (_wcsnicmp_l(W, L"a", 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_wcsnicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _wcsnicmp_l(W, L"a", 1, locale) != 0)
-
-  if (_mbscmp(U, V))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbscmp' is called without explicitly comparing result
-  // CHECK-FIXES: _mbscmp(U, V) != 0)
-
-  if (_mbsncmp(U, V, 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsncmp' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsncmp(U, V, 1) != 0)
-
-  if (_mbsnbcmp(U, V, 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsnbcmp' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsnbcmp(U, V, 1) != 0)
-
-  if (_mbsnbicmp(U, V, 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsnbicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsnbicmp(U, V, 1) != 0)
-
-  if (_mbsicmp(U, V))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsicmp(U, V) != 0)
-
-  if (_mbsnicmp(U, V, 1))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsnicmp' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsnicmp(U, V, 1) != 0)
-
-  if (_mbscmp_l(U, V, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbscmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _mbscmp_l(U, V, locale) != 0)
-
-  if (_mbsncmp_l(U, V, 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsncmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsncmp_l(U, V, 1, locale) != 0)
-
-  if (_mbsicmp_l(U, V, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsicmp_l(U, V, locale) != 0)
-
-  if (_mbsnicmp_l(U, V, 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsnicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsnicmp_l(U, V, 1, locale) != 0)
-
-  if (_mbsnbcmp_l(U, V, 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsnbcmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsnbcmp_l(U, V, 1, locale) != 0)
-
-  if (_mbsnbicmp_l(U, V, 1, locale))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function '_mbsnbicmp_l' is called without explicitly comparing result
-  // CHECK-FIXES: _mbsnbicmp_l(U, V, 1, locale) != 0)
-
-  return 1;
-}
-
-int strcmp_wrapper1(const char* a, const char* b) {
-  return strcmp(a, b);
-}
-
-int strcmp_wrapper2(const char* a, const char* b) {
-  return (a && b) ? strcmp(a, b) : 0;
-}
-
-#define macro_strncmp(s1, s2, n)                                              \
-  (__extension__ (__builtin_constant_p (n)                                    \
-                  && ((__builtin_constant_p (s1)                              \
-                       && strlen (s1) < ((size) (n)))                         \
-                      || (__builtin_constant_p (s2)                           \
-                          && strlen (s2) < ((size) (n))))                     \
-                  ? strcmp (s1, s2) : strncmp (s1, s2, n)))
-
-int strncmp_macro(const char* a, const char* b) {
-  if (macro_strncmp(a, b, 4))
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is called without explicitly comparing result
-
-  if (macro_strncmp(a, b, 4) == 2)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' is compared to a suspicious constant
-
-  if (macro_strncmp(a, b, 4) <= .0)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: function 'strcmp' has suspicious implicit cast
-
-  if (macro_strncmp(a, b, 4) + 0)
-    return 0;
-  // CHECK-MESSAGES: [[@LINE-2]]:7: warning: results of function 'strcmp' used by operator '+'
-
-  return 1;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-swapped-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-swapped-arguments.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-swapped-arguments.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-swapped-arguments.cpp (removed)
@@ -1,53 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-swapped-arguments %t
-
-void F(int, double);
-
-int SomeFunction();
-
-template <typename T, typename U>
-void G(T a, U b) {
-  F(a, b); // no-warning
-  F(2.0, 4);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.
-// CHECK-FIXES: F(4, 2.0)
-}
-
-void foo() {
-  F(1.0, 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.
-// CHECK-FIXES: F(3, 1.0)
-
-#define M(x, y) x##y()
-
-  double b = 1.0;
-  F(b, M(Some, Function));
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.
-// CHECK-FIXES: F(M(Some, Function), b);
-
-#define N F(b, SomeFunction())
-
-  N;
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.
-// In macro, don't emit fixits.
-// CHECK-FIXES: #define N F(b, SomeFunction())
-
-  G(b, 3);
-  G(3, 1.0);
-  G(0, 0);
-
-  F(1.0, 1.0);    // no-warning
-  F(3, 1.0);      // no-warning
-  F(true, false); // no-warning
-  F(0, 'c');      // no-warning
-
-#define APPLY(f, x, y) f(x, y)
-  APPLY(F, 1.0, 3);
-// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.
-// CHECK-FIXES: APPLY(F, 3, 1.0);
-
-#define PARAMS 1.0, 3
-#define CALL(P) F(P)
-  CALL(PARAMS);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.
-// In macro, don't emit fixits.
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-terminating-continue.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-terminating-continue.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-terminating-continue.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-terminating-continue.cpp (removed)
@@ -1,65 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-terminating-continue %t
-
-void f() {
-  do {
-    continue;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue]
-    // CHECK-FIXES: break;
-  } while(false);
-
-  do {
-    continue;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue]
-    // CHECK-FIXES: break;
-  } while(0);
-
-  do {
-    continue;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue]
-    // CHECK-FIXES: break;
-  } while(nullptr);
-
-  do {
-    continue;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue]
-    // CHECK-FIXES: break;
-  } while(__null);
-
-
-  do {
-    int x = 1;
-    if (x > 0) continue;
-    // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue]
-    // CHECK-FIXES: if (x > 0) break;
-  } while (false);
-}
-
-void g() {
-  do {
-    do {
-      continue;
-      int x = 1;
-    } while (1 == 1);
-  } while (false);
-
-  do {
-    for (int i = 0; i < 1; ++i) {
-      continue;
-      int x = 1;
-    }
-  } while (false);
-
-  do {
-    while (true) {
-      continue;
-      int x = 1;
-    }
-  } while (false);
-
-  int v[] = {1,2,3,34};
-  do {
-    for (int n : v) {
-      if (n>2) continue;
-    }
-  } while (false);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-throw-keyword-missing.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-throw-keyword-missing.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-throw-keyword-missing.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-throw-keyword-missing.cpp (removed)
@@ -1,167 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-throw-keyword-missing %t -- -- -fexceptions
-
-namespace std {
-
-// std::string declaration (taken from test/clang-tidy/readability-redundant-string-cstr-msvc.cpp).
-template <typename T>
-class allocator {};
-template <typename T>
-class char_traits {};
-template <typename C, typename T = std::char_traits<C>, typename A = std::allocator<C>>
-struct basic_string {
-  basic_string();
-  basic_string(const basic_string &);
-  // MSVC headers define two constructors instead of using optional arguments.
-  basic_string(const C *);
-  basic_string(const C *, const A &);
-  ~basic_string();
-};
-typedef basic_string<char> string;
-typedef basic_string<wchar_t> wstring;
-
-// std::exception and std::runtime_error declaration.
-struct exception {
-  exception();
-  exception(const exception &other);
-  virtual ~exception();
-};
-
-struct runtime_error : public exception {
-  explicit runtime_error(const std::string &what_arg);
-};
-
-} // namespace std
-
-// The usage of this class should never emit a warning.
-struct RegularClass {};
-
-// Class name contains the substring "exception", in certain cases using this class should emit a warning.
-struct RegularException {
-  RegularException() {}
-
-  // Constructors with a single argument are treated differently (cxxFunctionalCastExpr).
-  RegularException(int) {}
-};
-
-// --------------
-
-void stdExceptionNotTrownTest(int i) {
-  if (i < 0)
-    // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: suspicious exception object created but not thrown; did you mean 'throw {{.*}}'? [bugprone-throw-keyword-missing]
-    std::exception();
-
-  if (i > 0)
-    // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: suspicious exception
-    std::runtime_error("Unexpected argument");
-}
-
-void stdExceptionThrownTest(int i) {
-  if (i < 0)
-    throw std::exception();
-
-  if (i > 0)
-    throw std::runtime_error("Unexpected argument");
-}
-
-void regularClassNotThrownTest(int i) {
-  if (i < 0)
-    RegularClass();
-}
-
-void regularClassThrownTest(int i) {
-  if (i < 0)
-    throw RegularClass();
-}
-
-void nameContainsExceptionNotThrownTest(int i) {
-  if (i < 0)
-    // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: suspicious exception
-    RegularException();
-
-  if (i > 0)
-    // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: suspicious exception
-    RegularException(5);
-}
-
-void nameContainsExceptionThrownTest(int i) {
-  if (i < 0)
-    throw RegularException();
-
-  if (i > 0)
-    throw RegularException(5);
-}
-
-template <class Exception>
-void f(int i, Exception excToBeThrown) {}
-
-void funcCallWithTempExcTest() {
-  f(5, RegularException());
-}
-
-// Global variable initilization test.
-RegularException exc = RegularException();
-RegularException *excptr = new RegularException();
-
-void localVariableInitTest() {
-  RegularException exc = RegularException();
-  RegularException *excptr = new RegularException();
-}
-
-class CtorInitializerListTest {
-  RegularException exc;
-
-  CtorInitializerListTest() : exc(RegularException()) {}
-
-  CtorInitializerListTest(int) try : exc(RegularException()) {
-    // Constructor body
-  } catch (...) {
-    // CHECK-MESSAGES: :[[@LINE+1]]:5: warning: suspicious exception
-    RegularException();
-  }
-
-  CtorInitializerListTest(float);
-};
-
-CtorInitializerListTest::CtorInitializerListTest(float) try : exc(RegularException()) {
-  // Constructor body
-} catch (...) {
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: suspicious exception
-  RegularException();
-}
-
-RegularException funcReturningExceptionTest(int i) {
-  return RegularException();
-}
-
-void returnedValueTest() {
-  funcReturningExceptionTest(3);
-}
-
-struct ClassBracedInitListTest {
-  ClassBracedInitListTest(RegularException exc) {}
-};
-
-void foo(RegularException, ClassBracedInitListTest) {}
-
-void bracedInitListTest() {
-  RegularException exc{};
-  ClassBracedInitListTest test = {RegularException()};
-  foo({}, {RegularException()});
-}
-
-typedef std::exception ERROR_BASE;
-class RegularError : public ERROR_BASE {};
-
-void typedefTest() {
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: suspicious exception
-  RegularError();
-}
-
-struct ExceptionRAII {
-  ExceptionRAII() {}
-  ~ExceptionRAII() {}
-};
-
-void exceptionRAIITest() {
-  ExceptionRAII E;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp (removed)
@@ -1,23 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-too-small-loop-variable %t -- -- --target=x86_64-linux
-
-// MagnitudeBitsUpperLimit = 16 (default value)
-
-unsigned long size() { return 294967296l; }
-
-void voidFilteredOutForLoop1() {
-  for (long i = 0; i < size(); ++i) {
-    // no warning
-  }
-}
-
-void voidCaughtForLoop1() {
-  for (int i = 0; i < size(); ++i) {
-    // no warning
-  }
-}
-
-void voidCaughtForLoop2() {
-  for (short i = 0; i < size(); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: loop variable has narrower type 'short' than iteration's upper bound 'unsigned long' [bugprone-too-small-loop-variable]
-  }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-too-small-loop-variable.cpp (removed)
@@ -1,255 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-too-small-loop-variable %t -- \
-// RUN:   -config="{CheckOptions: \
-// RUN:             [{key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit, \
-// RUN:               value: 1024}]}" \
-// RUN:   -- --target=x86_64-linux
-
-long size() { return 294967296l; }
-
-////////////////////////////////////////////////////////////////////////////////
-/// Test cases correctly caught by bugprone-too-small-loop-variable.
-
-void voidBadForLoop() {
-  for (int i = 0; i < size(); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: loop variable has narrower type 'int' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidBadForLoop2() {
-  for (int i = 0; i < size() + 10; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: loop variable has narrower type 'int' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidBadForLoop3() {
-  for (int i = 0; i <= size() - 1; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: loop variable has narrower type 'int' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidBadForLoop4() {
-  for (int i = 0; size() > i; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: loop variable has narrower type 'int' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidBadForLoop5() {
-  for (int i = 0; size() - 1 >= i; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: loop variable has narrower type 'int' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidBadForLoop6() {
-  int i = 0;
-  for (; i < size(); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: loop variable has narrower type 'int' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidForLoopUnsignedBound() {
-  unsigned size = 3147483647;
-  for (int i = 0; i < size; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: loop variable has narrower type 'int' than iteration's upper bound 'unsigned int' [bugprone-too-small-loop-variable]
-  }
-}
-
-// The iteration's upper bound has a template dependent value.
-template <long size>
-void doSomething() {
-  for (short i = 0; i < size; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: loop variable has narrower type 'short' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-// The iteration's upper bound has a template dependent type.
-template <class T>
-void doSomething() {
-  for (T i = 0; i < size(); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: loop variable has narrower type 'short' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidForLoopInstantiation() {
-  // This line does not trigger the warning.
-  doSomething<long>();
-  // This one triggers the warning.
-  doSomething<short>();
-}
-
-// A suspicious function used in a macro.
-#define SUSPICIOUS_SIZE (size())
-void voidBadForLoopWithMacroBound() {
-  for (short i = 0; i < SUSPICIOUS_SIZE; ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: loop variable has narrower type 'short' than iteration's upper bound 'long' [bugprone-too-small-loop-variable]
-  }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Correct loops: we should not warn here.
-
-// A simple use case when both expressions have the same type.
-void voidGoodForLoop() {
-  for (long i = 0; i < size(); ++i) { // no warning
-  }
-}
-
-// Other use case where both expressions have the same type,
-// but short expressions are converted to int by the compare operator.
-void voidGoodForLoop2() {
-  short loopCond = 10;
-  for (short i = 0; i < loopCond; ++i) { // no warning
-  }
-}
-
-// Because of the integer literal, the iteration's upper bound is int, but we suppress the warning here.
-void voidForLoopShortPlusLiteral() {
-  short size = 30000;
-  for (short i = 0; i <= (size - 1); ++i) { // no warning
-  }
-}
-
-// Addition of two short variables results in an int value, but we suppress this to avoid false positives.
-void voidForLoopShortPlusShort() {
-  short size = 256;
-  short increment = 14;
-  for (short i = 0; i < size + increment; ++i) { // no warning
-  }
-}
-
-// In this test case we have different integer types, but here the loop variable has the bigger type.
-// The iteration's bound is cast implicitly, not the loop variable.
-void voidForLoopBoundImplicitCast() {
-  short start = 256;
-  short end = 14;
-  for (int i = start; i >= end; --i) { // no warning
-  }
-}
-
-// Range based loop and other iterator based loops are ignored by this check.
-void voidRangeBasedForLoop() {
-  int array[] = {1, 2, 3, 4, 5};
-  for (const int &i : array) { // no warning
-  }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Future possibilites to improve the check.
-
-// False positive: because of the int literal, iteration's upper bound has int type.
-void voidForLoopFalsePositive() {
-  short size = 30000;
-  bool cond = false;
-  for (short i = 0; i < (cond ? 0 : size); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: loop variable has narrower type 'short' than iteration's upper bound 'int' [bugprone-too-small-loop-variable]
-  }
-}
-
-void voidForLoopFalsePositive2() {
-  short size = 30000;
-  bool cond = false;
-  for (short i = 0; i < (!cond ? size : 0); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: loop variable has narrower type 'short' than iteration's upper bound 'int' [bugprone-too-small-loop-variable]
-  }
-}
-
-// False positive: The loop bound expression contains nested binary operators.
-void voidForLoopFalsePositive3() {
-  short number = 30000;
-  for (short i = 0; i < ((number & 0x7f) + 1); ++i) {
-    // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: loop variable has narrower type 'short' than iteration's upper bound 'int' [bugprone-too-small-loop-variable]
-  }
-}
-
-// TODO: handle while loop.
-void voidBadWhileLoop() {
-  short i = 0;
-  while (i < size()) { // missing warning
-    ++i;
-  }
-}
-
-// TODO: handle do-while loop.
-void voidBadDoWhileLoop() {
-  short i = 0;
-  do {
-    ++i;
-  } while (i < size()); // missing warning
-}
-
-// TODO: handle complex loop conditions.
-void voidComplexForCond() {
-  bool additionalCond = true;
-  for (int i = 0; i < size() && additionalCond; ++i) { // missing warning
-  }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Suspicious test cases ingored by this check.
-
-// Test case with a reverse iteration.
-// This is caught by -Wimplicit-int-conversion.
-void voidReverseForLoop() {
-  for (short i = size() - 1; i >= 0; --i) { // no warning
-  }
-}
-
-// Macro defined literals are used inside the loop condition.
-#define SIZE 125
-#define SIZE2 (SIZE + 1)
-void voidForLoopWithMacroBound() {
-  for (short i = 0; i < SIZE2; ++i) { // no warning
-  }
-}
-
-// A suspicious loop is not caught if the iteration's upper bound is a literal.
-void voidForLoopWithLiteralBound() {
-  for (short i = 0; i < 125; ++i) { // no warning
-  }
-}
-
-// The used literal leads to an infinite loop.
-// This is caught by -Wtautological-constant-out-of-range-compare.
-void voidForLoopWithBigLiteralBound() {
-  for (short i = 0; i < 294967296l; ++i) { // no warning
-  }
-}
-
-enum eSizeType {
-  START,
-  Y,
-  END
-};
-
-// A suspicious loop is not caught if the iteration's upper bound is an enum value.
-void voidForLoopWithEnumBound() {
-  for (short i = eSizeType::START; i < eSizeType::END; ++i) { // no warning
-  }
-}
-
-enum eSizeType2 : long {
-  START2 = 294967296l,
-  Y2,
-  END2
-};
-
-// The used enum value leads to an infinite loop.
-// This is caught by -Wtautological-constant-out-of-range-compare.
-void voidForLoopWithBigEnumBound() {
-  for (short i = eSizeType2::START2; i < eSizeType2::END2; ++i) { // no warning
-  }
-}
-
-// A suspicious loop is not caught if the iteration's upper bound is a constant variable.
-void voidForLoopWithConstBound() {
-  const long size = 252l;
-  for (short i = 0; i < size; ++i) { // no warning
-  }
-}
-
-// The used constant variable leads to an infinite loop.
-// This is caught by -Wtautological-constant-out-of-range-compare.
-void voidForLoopWithBigConstBound() {
-  const long size = 294967296l;
-  for (short i = 0; i < size; ++i) { // no warning
-  }
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-undefined-memory-manipulation.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-undefined-memory-manipulation.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-undefined-memory-manipulation.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-undefined-memory-manipulation.cpp (removed)
@@ -1,213 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-undefined-memory-manipulation %t
-
-void *memset(void *, int, __SIZE_TYPE__);
-void *memcpy(void *, const void *, __SIZE_TYPE__);
-void *memmove(void *, const void *, __SIZE_TYPE__);
-
-namespace std {
-using ::memcpy;
-using ::memmove;
-using ::memset;
-}
-
-namespace types {
-// TriviallyCopyable types:
-struct Plain {
-  int n;
-};
-
-enum E {
-  X,
-  Y,
-  Z
-};
-
-struct Base {
-  float b;
-};
-
-struct Derived : Base {
-  bool d;
-};
-
-// not TriviallyCopyable types:
-struct Destruct {
-  ~Destruct() {}
-};
-
-struct Copy {
-  Copy() {}
-  Copy(const Copy &) {}
-};
-
-struct Move {
-  Move() {}
-  Move(Move &&) {}
-};
-
-struct VirtualFunc {
-  virtual void f() {}
-};
-
-struct VirtualBase : virtual Base {
-  int vb;
-};
-
-// Incomplete type, assume it is TriviallyCopyable.
-struct NoDef;
-
-} // end namespace types
-
-void f(types::NoDef *s) {
-  memset(s, 0, 5);
-}
-
-template <typename T>
-void memset_temp(T *b) {
-  memset(b, 0, sizeof(T));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualFunc' is not TriviallyCopyable [bugprone-undefined-memory-manipulation]
-}
-
-template <typename S, typename T>
-void memcpy_temp(S *a, T *b) {
-  memcpy(a, b, sizeof(T));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::VirtualFunc'
-}
-
-template <typename S, typename T>
-void memmove_temp(S *a, T *b) {
-  memmove(a, b, sizeof(T));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::VirtualFunc'
-}
-
-namespace aliases {
-using Copy2 = types::Copy;
-typedef types::Move Move2;
-}
-
-void notTriviallyCopyable() {
-  types::Plain p; // TriviallyCopyable for variety
-  types::Destruct d;
-  types::Copy c;
-  types::Move m;
-  types::VirtualFunc vf;
-  types::VirtualBase vb;
-
-  memset(&vf, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualFunc'
-  memset(&d, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Destruct'
-  memset(&c, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Copy'
-  std::memset(&m, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Move'
-  ::memset(&vb, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualBase'
-
-  memcpy(&p, &vf, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::VirtualFunc'
-  memcpy(&p, &d, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::Destruct'
-  memcpy(&c, &p, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Copy'
-  std::memcpy(&m, &p, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Move'
-  ::memcpy(&vb, &p, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualBase'
-
-  memmove(&vf, &p, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualFunc'
-  memmove(&d, &p, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Destruct'
-  memmove(&p, &c, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::Copy'
-  std::memmove(&p, &m, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::Move'
-  ::memmove(&p, &vb, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::VirtualBase'
-
-#define MEMSET memset(&vf, 0, sizeof(int));
-  MEMSET
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualFunc'
-#define MEMCPY memcpy(&d, &p, sizeof(int));
-  MEMCPY
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Destruct'
-#define MEMMOVE memmove(&p, &c, sizeof(int));
-  MEMMOVE
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::Copy'
-
-  memset_temp<types::VirtualFunc>(&vf);
-  memcpy_temp<types::Plain, types::VirtualFunc>(&p, &vf);
-  memmove_temp<types::Plain, types::VirtualFunc>(&p, &vf);
-
-  aliases::Copy2 c2;
-  aliases::Move2 m2;
-  memset(&c2, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'aliases::Copy2'
-  memset(&m2, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'aliases::Move2'
-
-  typedef aliases::Copy2 Copy3;
-  typedef aliases::Copy2 *PCopy2;
-  typedef Copy3 *PCopy3;
-  Copy3 c3;
-  PCopy2 pc2;
-  PCopy3 pc3;
-  memset(&c3, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'Copy3'
-  memset(pc2, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'aliases::Copy2'
-  memset(pc3, 0, sizeof(int));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'Copy3'
-}
-
-void triviallyCopyable() {
-  types::Plain p;
-  types::Base base;
-  types::Derived derived;
-
-  int i = 5;
-  int ia[3] = {1, 2, 3};
-  float f = 3.14;
-  float fa[3] = {1.1, 2.2, 3.3};
-  bool b = false;
-  bool ba[2] = {true, false};
-  types::E e = types::X;
-  p.n = 2;
-
-  memset(&p, 0, sizeof(int));
-  memset(&base, 0, sizeof(float));
-  memset(&derived, 0, sizeof(bool));
-  memset(&i, 0, sizeof(int));
-  memset(ia, 0, sizeof(int));
-  memset(&f, 0, sizeof(float));
-  memset(fa, 0, sizeof(float));
-  memset(&b, 0, sizeof(bool));
-  memset(ba, 0, sizeof(bool));
-  memset(&e, 0, sizeof(int));
-  memset(&p.n, 0, sizeof(int));
-
-  memcpy(&p, &p, sizeof(int));
-  memcpy(&base, &base, sizeof(float));
-  memcpy(&derived, &derived, sizeof(bool));
-  memcpy(&i, &i, sizeof(int));
-  memcpy(ia, ia, sizeof(int));
-  memcpy(&f, &f, sizeof(float));
-  memcpy(fa, fa, sizeof(float));
-  memcpy(&b, &b, sizeof(bool));
-  memcpy(ba, ba, sizeof(bool));
-  memcpy(&e, &e, sizeof(int));
-  memcpy(&p.n, &p.n, sizeof(int));
-
-  memmove(&p, &p, sizeof(int));
-  memmove(&base, &base, sizeof(float));
-  memmove(&derived, &derived, sizeof(bool));
-  memmove(&i, &i, sizeof(int));
-  memmove(ia, ia, sizeof(int));
-  memmove(&f, &f, sizeof(float));
-  memmove(fa, fa, sizeof(float));
-  memmove(&b, &b, sizeof(bool));
-  memmove(ba, ba, sizeof(bool));
-  memmove(&e, &e, sizeof(int));
-  memmove(&p.n, &p.n, sizeof(int));
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor-cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor-cxx98.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor-cxx98.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor-cxx98.cpp (removed)
@@ -1,23 +0,0 @@
-// RUN: clang-tidy %s -checks=-*,bugprone-undelegated-constructor -- -std=c++98 | count 0
-
-// Note: this test expects no diagnostics, but FileCheck cannot handle that,
-// hence the use of | count 0.
-
-struct Ctor;
-Ctor foo();
-
-struct Ctor {
-  Ctor();
-  Ctor(int);
-  Ctor(int, int);
-  Ctor(Ctor *i) {
-    Ctor();
-    Ctor(0);
-    Ctor(1, 2);
-    foo();
-  }
-};
-
-Ctor::Ctor() {
-  Ctor(1);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-undelegated-constructor.cpp (removed)
@@ -1,54 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-undelegated-constructor %t
-
-struct Ctor;
-Ctor foo();
-
-struct Ctor {
-  Ctor();
-  Ctor(int);
-  Ctor(int, int);
-  Ctor(Ctor *i) {
-    Ctor();
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead [bugprone-undelegated-constructor]
-    Ctor(0);
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
-    Ctor(1, 2);
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
-    foo();
-  }
-};
-
-Ctor::Ctor() {
-  Ctor(1);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: did you intend to call a delegated constructor?
-}
-
-Ctor::Ctor(int i) : Ctor(i, 1) {} // properly delegated.
-
-struct Dtor {
-  Dtor();
-  Dtor(int);
-  Dtor(int, int);
-  Dtor(Ctor *i) {
-    Dtor();
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
-    Dtor(0);
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
-    Dtor(1, 2);
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
-  }
-  ~Dtor();
-};
-
-struct Base {};
-struct Derived : public Base {
-  Derived() { Base(); }
-// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: did you intend to call a delegated constructor?
-};
-
-template <typename T>
-struct TDerived : public Base {
-  TDerived() { Base(); }
-};
-
-TDerived<int> t;

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp (removed)
@@ -1,41 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-unhandled-self-assignment %t -- \
-// RUN:   -config="{CheckOptions: \
-// RUN:             [{key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField, \
-// RUN:               value: 0}]}"
-
-// Classes with pointer field are still caught.
-class PtrField {
-public:
-  PtrField &operator=(const PtrField &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:13: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// With the option, check catches classes with trivial fields.
-class TrivialFields {
-public:
-  TrivialFields &operator=(const TrivialFields &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:18: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    return *this;
-  }
-
-private:
-  int m;
-  float f;
-  double d;
-  bool b;
-};
-
-// The check warns also when there is no field at all.
-// In this case, user-defined copy assignment operator is useless anyway.
-class ClassWithoutFields {
-public:
-  ClassWithoutFields &operator=(const ClassWithoutFields &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:23: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    return *this;
-  }
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-unhandled-self-assignment.cpp (removed)
@@ -1,579 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-unhandled-self-assignment %t -- -- -fno-delayed-template-parsing
-
-namespace std {
-
-template <class T>
-void swap(T x, T y) {
-}
-
-template <class T>
-T &&move(T x) {
-}
-
-template <class T>
-class unique_ptr {
-};
-
-template <class T>
-class shared_ptr {
-};
-
-template <class T>
-class weak_ptr {
-};
-
-template <class T>
-class auto_ptr {
-};
-
-} // namespace std
-
-void assert(int expression){};
-
-///////////////////////////////////////////////////////////////////
-/// Test cases correctly caught by the check.
-
-class PtrField {
-public:
-  PtrField &operator=(const PtrField &object);
-
-private:
-  int *p;
-};
-
-PtrField &PtrField::operator=(const PtrField &object) {
-  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-  // ...
-  return *this;
-}
-
-// Class with an inline operator definition.
-class InlineDefinition {
-public:
-  InlineDefinition &operator=(const InlineDefinition &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:21: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-class UniquePtrField {
-public:
-  UniquePtrField &operator=(const UniquePtrField &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:19: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  std::unique_ptr<int> p;
-};
-
-class SharedPtrField {
-public:
-  SharedPtrField &operator=(const SharedPtrField &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:19: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  std::shared_ptr<int> p;
-};
-
-class WeakPtrField {
-public:
-  WeakPtrField &operator=(const WeakPtrField &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:17: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  std::weak_ptr<int> p;
-};
-
-class AutoPtrField {
-public:
-  AutoPtrField &operator=(const AutoPtrField &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:17: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  std::auto_ptr<int> p;
-};
-
-// Class with C array field.
-class CArrayField {
-public:
-  CArrayField &operator=(const CArrayField &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:16: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  int array[256];
-};
-
-// Make sure to not ignore cases when the operator definition calls
-// a copy constructor of another class.
-class CopyConstruct {
-public:
-  CopyConstruct &operator=(const CopyConstruct &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:18: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    WeakPtrField a;
-    WeakPtrField b(a);
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// Make sure to not ignore cases when the operator definition calls
-// a copy assignment operator of another class.
-class AssignOperator {
-public:
-  AssignOperator &operator=(const AssignOperator &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:19: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    a.operator=(object.a);
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-  WeakPtrField a;
-};
-
-class NotSelfCheck {
-public:
-  NotSelfCheck &operator=(const NotSelfCheck &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:17: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    if (&object == this->doSomething()) {
-      // ...
-    }
-    return *this;
-  }
-
-  void *doSomething() {
-    return p;
-  }
-
-private:
-  int *p;
-};
-
-template <class T>
-class TemplatePtrField {
-public:
-  TemplatePtrField<T> &operator=(const TemplatePtrField<T> &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:24: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  T *p;
-};
-
-template <class T>
-class TemplateCArrayField {
-public:
-  TemplateCArrayField<T> &operator=(const TemplateCArrayField<T> &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:27: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    // ...
-    return *this;
-  }
-
-private:
-  T p[256];
-};
-
-// Other template class's constructor is called inside a declaration.
-template <class T>
-class WrongTemplateCopyAndMove {
-public:
-  WrongTemplateCopyAndMove<T> &operator=(const WrongTemplateCopyAndMove<T> &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:32: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    TemplatePtrField<T> temp;
-    TemplatePtrField<T> temp2(temp);
-    return *this;
-  }
-
-private:
-  T *p;
-};
-
-///////////////////////////////////////////////////////////////////
-/// Test cases correctly ignored by the check.
-
-// Self-assignment is checked using the equality operator.
-class SelfCheck1 {
-public:
-  SelfCheck1 &operator=(const SelfCheck1 &object) {
-    if (this == &object)
-      return *this;
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-class SelfCheck2 {
-public:
-  SelfCheck2 &operator=(const SelfCheck2 &object) {
-    if (&object == this)
-      return *this;
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// Self-assignment is checked using the inequality operator.
-class SelfCheck3 {
-public:
-  SelfCheck3 &operator=(const SelfCheck3 &object) {
-    if (this != &object) {
-      // ...
-    }
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-class SelfCheck4 {
-public:
-  SelfCheck4 &operator=(const SelfCheck4 &object) {
-    if (&object != this) {
-      // ...
-    }
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-template <class T>
-class TemplateSelfCheck {
-public:
-  TemplateSelfCheck<T> &operator=(const TemplateSelfCheck<T> &object) {
-    if (&object != this) {
-      // ...
-    }
-    return *this;
-  }
-
-private:
-  T *p;
-};
-
-// There is no warning if the copy assignment operator gets the object by value.
-class PassedByValue {
-public:
-  PassedByValue &operator=(PassedByValue object) {
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// User-defined swap method calling std::swap inside.
-class CopyAndSwap1 {
-public:
-  CopyAndSwap1 &operator=(const CopyAndSwap1 &object) {
-    CopyAndSwap1 temp(object);
-    doSwap(temp);
-    return *this;
-  }
-
-private:
-  int *p;
-
-  void doSwap(CopyAndSwap1 &object) {
-    using std::swap;
-    swap(p, object.p);
-  }
-};
-
-// User-defined swap method used with passed-by-value parameter.
-class CopyAndSwap2 {
-public:
-  CopyAndSwap2 &operator=(CopyAndSwap2 object) {
-    doSwap(object);
-    return *this;
-  }
-
-private:
-  int *p;
-
-  void doSwap(CopyAndSwap2 &object) {
-    using std::swap;
-    swap(p, object.p);
-  }
-};
-
-// Copy-and-swap method is used but without creating a separate method for it.
-class CopyAndSwap3 {
-public:
-  CopyAndSwap3 &operator=(const CopyAndSwap3 &object) {
-    CopyAndSwap3 temp(object);
-    std::swap(p, temp.p);
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-template <class T>
-class TemplateCopyAndSwap {
-public:
-  TemplateCopyAndSwap<T> &operator=(const TemplateCopyAndSwap<T> &object) {
-    TemplateCopyAndSwap<T> temp(object);
-    std::swap(p, temp.p);
-    return *this;
-  }
-
-private:
-  T *p;
-};
-
-// Move semantics is used on a temporary copy of the object.
-class CopyAndMove1 {
-public:
-  CopyAndMove1 &operator=(const CopyAndMove1 &object) {
-    CopyAndMove1 temp(object);
-    *this = std::move(temp);
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// There is no local variable for the temporary copy.
-class CopyAndMove2 {
-public:
-  CopyAndMove2 &operator=(const CopyAndMove2 &object) {
-    *this = std::move(CopyAndMove2(object));
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-template <class T>
-class TemplateCopyAndMove {
-public:
-  TemplateCopyAndMove<T> &operator=(const TemplateCopyAndMove<T> &object) {
-    TemplateCopyAndMove<T> temp(object);
-    *this = std::move(temp);
-    return *this;
-  }
-
-private:
-  T *p;
-};
-
-// There is no local variable for the temporary copy.
-template <class T>
-class TemplateCopyAndMove2 {
-public:
-  TemplateCopyAndMove2<T> &operator=(const TemplateCopyAndMove2<T> &object) {
-    *this = std::move(TemplateCopyAndMove2<T>(object));
-    return *this;
-  }
-
-private:
-  T *p;
-};
-
-// We should not catch move assignment operators.
-class MoveAssignOperator {
-public:
-  MoveAssignOperator &operator=(MoveAssignOperator &&object) {
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// We ignore copy assignment operators without user-defined implementation.
-class DefaultOperator {
-public:
-  DefaultOperator &operator=(const DefaultOperator &object) = default;
-
-private:
-  int *p;
-};
-
-class DeletedOperator {
-public:
-  DeletedOperator &operator=(const DefaultOperator &object) = delete;
-
-private:
-  int *p;
-};
-
-class ImplicitOperator {
-private:
-  int *p;
-};
-
-// Check ignores those classes which has no any pointer or array field.
-class TrivialFields {
-public:
-  TrivialFields &operator=(const TrivialFields &object) {
-    // ...
-    return *this;
-  }
-
-private:
-  int m;
-  float f;
-  double d;
-  bool b;
-};
-
-// There is no warning when the class calls another assignment operator on 'this'
-// inside the copy assignment operator's definition.
-class AssignIsForwarded {
-public:
-  AssignIsForwarded &operator=(const AssignIsForwarded &object) {
-    operator=(object.p);
-    return *this;
-  }
-
-  AssignIsForwarded &operator=(int *pp) {
-    if (p != pp) {
-      delete p;
-      p = new int(*pp);
-    }
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// Assertion is a valid way to say that self-assignment is not expected to happen.
-class AssertGuard {
-public:
-  AssertGuard &operator=(const AssertGuard &object) {
-    assert(this != &object);
-    // ...
-    return *this;
-  }
-
-private:
-  int *p;
-};
-
-// Make sure we don't catch this operator=() as a copy assignment operator.
-// Note that RHS has swapped template arguments.
-template <typename Ty, typename Uy>
-class NotACopyAssignmentOperator {
-  Ty *Ptr1;
-  Uy *Ptr2;
-
-public:
-  NotACopyAssignmentOperator& operator=(const NotACopyAssignmentOperator<Uy, Ty> &RHS) {
-    Ptr1 = RHS.getUy();
-    Ptr2 = RHS.getTy();
-    return *this;
-  }
-
-  Ty *getTy() const { return Ptr1; }
-  Uy *getUy() const { return Ptr2; }
-};
-
-///////////////////////////////////////////////////////////////////
-/// Test cases which should be caught by the check.
-
-// TODO: handle custom pointers.
-template <class T>
-class custom_ptr {
-};
-
-class CustomPtrField {
-public:
-  CustomPtrField &operator=(const CustomPtrField &object) {
-    // ...
-    return *this;
-  }
-
-private:
-  custom_ptr<int> p;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/// False positives: These are self-assignment safe, but they don't use any of the three patterns.
-
-class ArrayCopy {
-public:
-  ArrayCopy &operator=(const ArrayCopy &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:14: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    for (int i = 0; i < 256; i++)
-      array[i] = object.array[i];
-    return *this;
-  }
-
-private:
-  int array[256];
-};
-
-class GetterSetter {
-public:
-  GetterSetter &operator=(const GetterSetter &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:17: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    setValue(object.getValue());
-    return *this;
-  }
-
-  int *getValue() const { return value; }
-
-  void setValue(int *newPtr) {
-    int *pTmp(newPtr ? new int(*newPtr) : nullptr);
-    std::swap(value, pTmp);
-    delete pTmp;
-  }
-
-private:
-  int *value;
-};
-
-class CustomSelfCheck {
-public:
-  CustomSelfCheck &operator=(const CustomSelfCheck &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:20: warning: operator=() does not handle self-assignment properly [bugprone-unhandled-self-assignment]
-    if (index != object.index) {
-      // ...
-    }
-    return *this;
-  }
-
-private:
-  int *value;
-  int index;
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-raii.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-raii.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-raii.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-raii.cpp (removed)
@@ -1,68 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-unused-raii %t
-
-struct Foo {
-  Foo();
-  Foo(int);
-  Foo(int, int);
-  ~Foo();
-};
-
-struct Bar {
-  Bar();
-};
-
-struct FooBar {
-  FooBar();
-  Foo f;
-};
-
-template <typename T>
-void qux() {
-  T(42);
-}
-
-template <typename T>
-struct TFoo {
-  TFoo(T);
-  ~TFoo();
-};
-
-Foo f();
-
-struct Ctor {
-  Ctor(int);
-  Ctor() {
-    Ctor(0); // TODO: warn here.
-  }
-};
-
-void test() {
-  Foo(42);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
-// CHECK-FIXES: Foo give_me_a_name(42);
-  Foo(23, 42);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
-// CHECK-FIXES: Foo give_me_a_name(23, 42);
-  Foo();
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
-// CHECK-FIXES: Foo give_me_a_name;
-  TFoo<int>(23);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
-// CHECK-FIXES: TFoo<int> give_me_a_name(23);
-
-  FooBar();
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
-// CHECK-FIXES: FooBar give_me_a_name;
-
-  Bar();
-  f();
-  qux<Foo>();
-
-#define M Foo();
-  M
-
-  {
-    Foo();
-  }
-  Foo();
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value-custom.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value-custom.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value-custom.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value-custom.cpp (removed)
@@ -1,108 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-unused-return-value %t \
-// RUN: -config='{CheckOptions: \
-// RUN:  [{key: bugprone-unused-return-value.CheckedFunctions, \
-// RUN:    value: "::fun;::ns::Outer::Inner::memFun;::ns::Type::staticFun;::ns::ClassTemplate::memFun;::ns::ClassTemplate::staticFun"}]}' \
-// RUN: --
-
-namespace std {
-
-template <typename T>
-T *launder(T *);
-
-} // namespace std
-
-namespace ns {
-
-struct Outer {
-  struct Inner {
-    bool memFun();
-  };
-};
-
-using AliasName = Outer;
-
-struct Derived : public Outer::Inner {};
-
-struct Retval {
-  int *P;
-  Retval() { P = new int; }
-  ~Retval() { delete P; }
-};
-
-struct Type {
-  Retval memFun();
-  static Retval staticFun();
-};
-
-template <typename T>
-struct ClassTemplate {
-  Retval memFun();
-  static Retval staticFun();
-};
-
-} // namespace ns
-
-int fun();
-void fun(int);
-
-void warning() {
-  fun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value returned by this function should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast the expression to void to silence this warning
-
-  (fun());
-  // CHECK-NOTES: [[@LINE-1]]:4: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:4: note: cast {{.*}} this warning
-
-  ns::Outer::Inner ObjA1;
-  ObjA1.memFun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  ns::AliasName::Inner ObjA2;
-  ObjA2.memFun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  ns::Derived ObjA3;
-  ObjA3.memFun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  ns::Type::staticFun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  ns::ClassTemplate<int> ObjA4;
-  ObjA4.memFun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  ns::ClassTemplate<int>::staticFun();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-}
-
-void noWarning() {
-  auto R1 = fun();
-
-  ns::Outer::Inner ObjB1;
-  auto R2 = ObjB1.memFun();
-
-  auto R3 = ns::Type::staticFun();
-
-  ns::ClassTemplate<int> ObjB2;
-  auto R4 = ObjB2.memFun();
-
-  auto R5 = ns::ClassTemplate<int>::staticFun();
-
-  // test calling a void overload of a checked function
-  fun(5);
-
-  // test discarding return value of functions that are not configured to be checked
-  int I = 1;
-  std::launder(&I);
-
-  ns::Type ObjB3;
-  ObjB3.memFun();
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-unused-return-value.cpp (removed)
@@ -1,238 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-unused-return-value %t -- -- -fexceptions
-
-namespace std {
-
-struct future {};
-
-enum class launch {
-  async,
-  deferred
-};
-
-template <typename Function, typename... Args>
-future async(Function &&, Args &&...);
-
-template <typename Function, typename... Args>
-future async(launch, Function &&, Args &&...);
-
-template <typename ForwardIt, typename T>
-ForwardIt remove(ForwardIt, ForwardIt, const T &);
-
-template <typename ForwardIt, typename UnaryPredicate>
-ForwardIt remove_if(ForwardIt, ForwardIt, UnaryPredicate);
-
-template <typename ForwardIt>
-ForwardIt unique(ForwardIt, ForwardIt);
-
-template <typename T>
-struct default_delete;
-
-template <typename T, typename Deleter = std::default_delete<T>>
-struct unique_ptr {
-  T *release() noexcept;
-};
-
-template <typename T>
-struct char_traits;
-
-template <typename T>
-struct allocator;
-
-template <typename CharT,
-          typename Traits = char_traits<CharT>,
-          typename Allocator = allocator<CharT>>
-struct basic_string {
-  bool empty() const;
-};
-
-typedef basic_string<char> string;
-
-template <typename T, typename Allocator = std::allocator<T>>
-struct vector {
-  bool empty() const noexcept;
-};
-
-// the check should be able to match std lib calls even if the functions are
-// declared inside inline namespaces
-inline namespace v1 {
-
-template <typename T>
-T *launder(T *);
-
-} // namespace v1
-} // namespace std
-
-struct Foo {
-  void f();
-};
-
-int increment(int i) {
-  return i + 1;
-}
-
-void useFuture(const std::future &fut);
-
-void warning() {
-  std::async(increment, 42);
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value returned by this function should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast the expression to void to silence this warning
-
-  std::async(std::launch::async, increment, 42);
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  Foo F;
-  std::launder(&F);
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  std::remove_if(nullptr, nullptr, nullptr);
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  std::unique(nullptr, nullptr);
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  std::unique_ptr<Foo> UPtr;
-  UPtr.release();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  std::string Str;
-  Str.empty();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  std::vector<Foo> Vec;
-  Vec.empty();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:3: note: cast {{.*}} this warning
-
-  // test discarding return values inside different kinds of statements
-
-  auto Lambda = [] { std::remove(nullptr, nullptr, 1); };
-  // CHECK-NOTES: [[@LINE-1]]:22: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:22: note: cast {{.*}} this warning
-
-  if (true)
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-  else if (true)
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-  else
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-
-  while (true)
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-
-  do
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-  while (true);
-
-  for (;;)
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-
-  for (std::remove(nullptr, nullptr, 1);;)
-    // CHECK-NOTES: [[@LINE-1]]:8: warning: the value {{.*}} should be used
-    // CHECK-NOTES: [[@LINE-2]]:8: note: cast {{.*}} this warning
-    ;
-
-  for (;; std::remove(nullptr, nullptr, 1))
-    // CHECK-NOTES: [[@LINE-1]]:11: warning: the value {{.*}} should be used
-    // CHECK-NOTES: [[@LINE-2]]:11: note: cast {{.*}} this warning
-    ;
-
-  for (auto C : "foo")
-    std::remove(nullptr, nullptr, 1);
-  // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-  // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-
-  switch (1) {
-  case 1:
-    std::remove(nullptr, nullptr, 1);
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-    // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-    break;
-  default:
-    std::remove(nullptr, nullptr, 1);
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-    // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-    break;
-  }
-
-  try {
-    std::remove(nullptr, nullptr, 1);
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-    // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-  } catch (...) {
-    std::remove(nullptr, nullptr, 1);
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: the value {{.*}} should be used
-    // CHECK-NOTES: [[@LINE-2]]:5: note: cast {{.*}} this warning
-  }
-}
-
-void noWarning() {
-  auto AsyncRetval1 = std::async(increment, 42);
-  auto AsyncRetval2 = std::async(std::launch::async, increment, 42);
-
-  Foo FNoWarning;
-  auto LaunderRetval = std::launder(&FNoWarning);
-
-  auto RemoveRetval = std::remove(nullptr, nullptr, 1);
-
-  auto RemoveIfRetval = std::remove_if(nullptr, nullptr, nullptr);
-
-  auto UniqueRetval = std::unique(nullptr, nullptr);
-
-  std::unique_ptr<Foo> UPtrNoWarning;
-  auto ReleaseRetval = UPtrNoWarning.release();
-
-  std::string StrNoWarning;
-  auto StrEmptyRetval = StrNoWarning.empty();
-
-  std::vector<Foo> VecNoWarning;
-  auto VecEmptyRetval = VecNoWarning.empty();
-
-  // test using the return value in different kinds of expressions
-  useFuture(std::async(increment, 42));
-  std::launder(&FNoWarning)->f();
-  delete std::launder(&FNoWarning);
-
-  if (std::launder(&FNoWarning))
-    ;
-  for (; std::launder(&FNoWarning);)
-    ;
-  while (std::launder(&FNoWarning))
-    ;
-  do
-    ;
-  while (std::launder(&FNoWarning));
-  switch (std::unique(1, 1))
-    ;
-
-  // cast to void should allow ignoring the return value
-  (void)std::async(increment, 42);
-
-  // test discarding return value of functions that are not configured to be checked
-  increment(1);
-
-  // test that the check is disabled inside GNU statement expressions
-  ({ std::async(increment, 42); });
-  auto StmtExprRetval = ({ std::async(increment, 42); });
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-use-after-move.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-use-after-move.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-use-after-move.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-use-after-move.cpp (removed)
@@ -1,1273 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-use-after-move %t -- -- -std=c++17 -fno-delayed-template-parsing
-
-typedef decltype(nullptr) nullptr_t;
-
-namespace std {
-typedef unsigned size_t;
-
-template <typename T>
-struct unique_ptr {
-  unique_ptr();
-  T *get() const;
-  explicit operator bool() const;
-  void reset(T *ptr);
-  T &operator*() const;
-  T *operator->() const;
-  T& operator[](size_t i) const;
-};
-
-template <typename T>
-struct shared_ptr {
-  shared_ptr();
-  T *get() const;
-  explicit operator bool() const;
-  void reset(T *ptr);
-  T &operator*() const;
-  T *operator->() const;
-};
-
-template <typename T>
-struct weak_ptr {
-  weak_ptr();
-  bool expired() const;
-};
-
-#define DECLARE_STANDARD_CONTAINER(name) \
-  template <typename T>                  \
-  struct name {                          \
-    name();                              \
-    void clear();                        \
-    bool empty();                        \
-  }
-
-#define DECLARE_STANDARD_CONTAINER_WITH_ASSIGN(name) \
-  template <typename T>                              \
-  struct name {                                      \
-    name();                                          \
-    void clear();                                    \
-    bool empty();                                    \
-    void assign(size_t, const T &);                  \
-  }
-
-DECLARE_STANDARD_CONTAINER_WITH_ASSIGN(basic_string);
-DECLARE_STANDARD_CONTAINER_WITH_ASSIGN(vector);
-DECLARE_STANDARD_CONTAINER_WITH_ASSIGN(deque);
-DECLARE_STANDARD_CONTAINER_WITH_ASSIGN(forward_list);
-DECLARE_STANDARD_CONTAINER_WITH_ASSIGN(list);
-DECLARE_STANDARD_CONTAINER(set);
-DECLARE_STANDARD_CONTAINER(map);
-DECLARE_STANDARD_CONTAINER(multiset);
-DECLARE_STANDARD_CONTAINER(multimap);
-DECLARE_STANDARD_CONTAINER(unordered_set);
-DECLARE_STANDARD_CONTAINER(unordered_map);
-DECLARE_STANDARD_CONTAINER(unordered_multiset);
-DECLARE_STANDARD_CONTAINER(unordered_multimap);
-
-typedef basic_string<char> string;
-
-template <typename>
-struct remove_reference;
-
-template <typename _Tp>
-struct remove_reference {
-  typedef _Tp type;
-};
-
-template <typename _Tp>
-struct remove_reference<_Tp &> {
-  typedef _Tp type;
-};
-
-template <typename _Tp>
-struct remove_reference<_Tp &&> {
-  typedef _Tp type;
-};
-
-template <typename _Tp>
-constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t) noexcept {
-  return static_cast<typename remove_reference<_Tp>::type &&>(__t);
-}
-
-} // namespace std
-
-class A {
-public:
-  A();
-  A(const A &);
-  A(A &&);
-
-  A &operator=(const A &);
-  A &operator=(A &&);
-
-  void foo() const;
-  int getInt() const;
-
-  operator bool() const;
-
-  int i;
-};
-
-template <class T>
-class AnnotatedContainer {
-public:
-  AnnotatedContainer();
-
-  void foo() const;
-  [[clang::reinitializes]] void clear();
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// General tests.
-
-// Simple case.
-void simple() {
-  A a;
-  a.foo();
-  A other_a = std::move(a);
-  a.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:15: note: move occurred here
-}
-
-// A warning should only be emitted for one use-after-move.
-void onlyFlagOneUseAfterMove() {
-  A a;
-  a.foo();
-  A other_a = std::move(a);
-  a.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:15: note: move occurred here
-  a.foo();
-}
-
-void moveAfterMove() {
-  // Move-after-move also counts as a use.
-  {
-    A a;
-    std::move(a);
-    std::move(a);
-    // CHECK-NOTES: [[@LINE-1]]:15: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // This is also true if the move itself turns into the use on the second loop
-  // iteration.
-  {
-    A a;
-    for (int i = 0; i < 10; ++i) {
-      std::move(a);
-      // CHECK-NOTES: [[@LINE-1]]:17: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-2]]:7: note: move occurred here
-      // CHECK-NOTES: [[@LINE-3]]:17: note: the use happens in a later loop
-    }
-  }
-}
-
-// Checks also works on function parameters that have a use-after move.
-void parameters(A a) {
-  std::move(a);
-  a.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
-}
-
-void standardSmartPtr() {
-  // std::unique_ptr<>, std::shared_ptr<> and std::weak_ptr<> are guaranteed to
-  // be null after a std::move. So the check only flags accesses that would
-  // dereference the pointer.
-  {
-    std::unique_ptr<A> ptr;
-    std::move(ptr);
-    ptr.get();
-    static_cast<bool>(ptr);
-    *ptr;
-    // CHECK-NOTES: [[@LINE-1]]:6: warning: 'ptr' used after it was moved
-    // CHECK-NOTES: [[@LINE-5]]:5: note: move occurred here
-  }
-  {
-    std::unique_ptr<A> ptr;
-    std::move(ptr);
-    ptr->foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  {
-    std::unique_ptr<A> ptr;
-    std::move(ptr);
-    ptr[0];
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  {
-    std::shared_ptr<A> ptr;
-    std::move(ptr);
-    ptr.get();
-    static_cast<bool>(ptr);
-    *ptr;
-    // CHECK-NOTES: [[@LINE-1]]:6: warning: 'ptr' used after it was moved
-    // CHECK-NOTES: [[@LINE-5]]:5: note: move occurred here
-  }
-  {
-    std::shared_ptr<A> ptr;
-    std::move(ptr);
-    ptr->foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  {
-    // std::weak_ptr<> cannot be dereferenced directly, so we only check that
-    // member functions may be called on it after a move.
-    std::weak_ptr<A> ptr;
-    std::move(ptr);
-    ptr.expired();
-  }
-  // Make sure we recognize std::unique_ptr<> or std::shared_ptr<> if they're
-  // wrapped in a typedef.
-  {
-    typedef std::unique_ptr<A> PtrToA;
-    PtrToA ptr;
-    std::move(ptr);
-    ptr.get();
-  }
-  {
-    typedef std::shared_ptr<A> PtrToA;
-    PtrToA ptr;
-    std::move(ptr);
-    ptr.get();
-  }
-  // And we don't get confused if the template argument is a little more
-  // involved.
-  {
-    struct B {
-      typedef A AnotherNameForA;
-    };
-    std::unique_ptr<B::AnotherNameForA> ptr;
-    std::move(ptr);
-    ptr.get();
-  }
-  // Make sure we treat references to smart pointers correctly.
-  {
-    std::unique_ptr<A> ptr;
-    std::unique_ptr<A>& ref_to_ptr = ptr;
-    std::move(ref_to_ptr);
-    ref_to_ptr.get();
-  }
-  {
-    std::unique_ptr<A> ptr;
-    std::unique_ptr<A>&& rvalue_ref_to_ptr = std::move(ptr);
-    std::move(rvalue_ref_to_ptr);
-    rvalue_ref_to_ptr.get();
-  }
-  // We don't give any special treatment to types that are called "unique_ptr"
-  // or "shared_ptr" but are not in the "::std" namespace.
-  {
-    struct unique_ptr {
-      void get();
-    } ptr;
-    std::move(ptr);
-    ptr.get();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-}
-
-// The check also works in member functions.
-class Container {
-  void useAfterMoveInMemberFunction() {
-    A a;
-    std::move(a);
-    a.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-};
-
-// We see the std::move() if it's inside a declaration.
-void moveInDeclaration() {
-  A a;
-  A another_a(std::move(a));
-  a.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-}
-
-// We see the std::move if it's inside an initializer list. Initializer lists
-// are a special case because they cause ASTContext::getParents() to return
-// multiple parents for certain nodes in their subtree. This is because
-// RecursiveASTVisitor visits both the syntactic and semantic forms of
-// InitListExpr, and the parent-child relationships are different between the
-// two forms.
-void moveInInitList() {
-  struct S {
-    A a;
-  };
-  A a;
-  S s{std::move(a)};
-  a.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here
-}
-
-void lambdas() {
-  // Use-after-moves inside a lambda should be detected.
-  {
-    A a;
-    auto lambda = [a] {
-      std::move(a);
-      a.foo();
-      // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here
-    };
-  }
-  // This is just as true if the variable was declared inside the lambda.
-  {
-    auto lambda = [] {
-      A a;
-      std::move(a);
-      a.foo();
-      // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here
-    };
-  }
-  // But don't warn if the move happened inside the lambda but the use happened
-  // outside -- because
-  // - the 'a' inside the lambda is a copy, and
-  // - we don't know when the lambda will get called anyway
-  {
-    A a;
-    auto lambda = [a] {
-      std::move(a);
-    };
-    a.foo();
-  }
-  // Warn if the use consists of a capture that happens after a move.
-  {
-    A a;
-    std::move(a);
-    auto lambda = [a]() { a.foo(); };
-    // CHECK-NOTES: [[@LINE-1]]:20: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // ...even if the capture was implicit.
-  {
-    A a;
-    std::move(a);
-    auto lambda = [=]() { a.foo(); };
-    // CHECK-NOTES: [[@LINE-1]]:20: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // Same tests but for capture by reference.
-  {
-    A a;
-    std::move(a);
-    auto lambda = [&a]() { a.foo(); };
-    // CHECK-NOTES: [[@LINE-1]]:21: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  {
-    A a;
-    std::move(a);
-    auto lambda = [&]() { a.foo(); };
-    // CHECK-NOTES: [[@LINE-1]]:20: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // But don't warn if the move happened after the capture.
-  {
-    A a;
-    auto lambda = [a]() { a.foo(); };
-    std::move(a);
-  }
-  // ...and again, same thing with an implicit move.
-  {
-    A a;
-    auto lambda = [=]() { a.foo(); };
-    std::move(a);
-  }
-  // Same tests but for capture by reference.
-  {
-    A a;
-    auto lambda = [&a]() { a.foo(); };
-    std::move(a);
-  }
-  {
-    A a;
-    auto lambda = [&]() { a.foo(); };
-    std::move(a);
-  }
-}
-
-// Use-after-moves are detected in uninstantiated templates if the moved type
-// is not a dependent type.
-template <class T>
-void movedTypeIsNotDependentType() {
-  T t;
-  A a;
-  std::move(a);
-  a.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
-}
-
-// And if the moved type is a dependent type, the use-after-move is detected if
-// the template is instantiated.
-template <class T>
-void movedTypeIsDependentType() {
-  T t;
-  std::move(t);
-  t.foo();
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 't' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
-}
-template void movedTypeIsDependentType<A>();
-
-// We handle the case correctly where the move consists of an implicit call
-// to a conversion operator.
-void implicitConversionOperator() {
-  struct Convertible {
-    operator A() && { return A(); }
-  };
-  void takeA(A a);
-
-  Convertible convertible;
-  takeA(std::move(convertible));
-  convertible;
-  // CHECK-NOTES: [[@LINE-1]]:3: warning: 'convertible' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:9: note: move occurred here
-}
-
-// Using decltype on an expression is not a use.
-void decltypeIsNotUse() {
-  A a;
-  std::move(a);
-  decltype(a) other_a;
-}
-
-// Ignore moves or uses that occur as part of template arguments.
-template <int>
-class ClassTemplate {
-public:
-  void foo(A a);
-};
-template <int>
-void functionTemplate(A a);
-void templateArgIsNotUse() {
-  {
-    // A pattern like this occurs in the EXPECT_EQ and ASSERT_EQ macros in
-    // Google Test.
-    A a;
-    ClassTemplate<sizeof(A(std::move(a)))>().foo(std::move(a));
-  }
-  {
-    A a;
-    functionTemplate<sizeof(A(std::move(a)))>(std::move(a));
-  }
-}
-
-// Ignore moves of global variables.
-A global_a;
-void ignoreGlobalVariables() {
-  std::move(global_a);
-  global_a.foo();
-}
-
-// Ignore moves of member variables.
-class IgnoreMemberVariables {
-  A a;
-  static A static_a;
-
-  void f() {
-    std::move(a);
-    a.foo();
-
-    std::move(static_a);
-    static_a.foo();
-  }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// Tests involving control flow.
-
-void useAndMoveInLoop() {
-  // Warn about use-after-moves if they happen in a later loop iteration than
-  // the std::move().
-  {
-    A a;
-    for (int i = 0; i < 10; ++i) {
-      a.foo();
-      // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE+2]]:7: note: move occurred here
-      // CHECK-NOTES: [[@LINE-3]]:7: note: the use happens in a later loop
-      std::move(a);
-    }
-  }
-  // However, this case shouldn't be flagged -- the scope of the declaration of
-  // 'a' is important.
-  {
-    for (int i = 0; i < 10; ++i) {
-      A a;
-      a.foo();
-      std::move(a);
-    }
-  }
-  // Same as above, except that we have an unrelated variable being declared in
-  // the same declaration as 'a'. This case is interesting because it tests that
-  // the synthetic DeclStmts generated by the CFG are sequenced correctly
-  // relative to the other statements.
-  {
-    for (int i = 0; i < 10; ++i) {
-      A a, other;
-      a.foo();
-      std::move(a);
-    }
-  }
-  // Don't warn if we return after the move.
-  {
-    A a;
-    for (int i = 0; i < 10; ++i) {
-      a.foo();
-      if (a.getInt() > 0) {
-        std::move(a);
-        return;
-      }
-    }
-  }
-}
-
-void differentBranches(int i) {
-  // Don't warn if the use is in a different branch from the move.
-  {
-    A a;
-    if (i > 0) {
-      std::move(a);
-    } else {
-      a.foo();
-    }
-  }
-  // Same thing, but with a ternary operator.
-  {
-    A a;
-    i > 0 ? (void)std::move(a) : a.foo();
-  }
-  // A variation on the theme above.
-  {
-    A a;
-    a.getInt() > 0 ? a.getInt() : A(std::move(a)).getInt();
-  }
-  // Same thing, but with a switch statement.
-  {
-    A a;
-    switch (i) {
-    case 1:
-      std::move(a);
-      break;
-    case 2:
-      a.foo();
-      break;
-    }
-  }
-  // However, if there's a fallthrough, we do warn.
-  {
-    A a;
-    switch (i) {
-    case 1:
-      std::move(a);
-    case 2:
-      a.foo();
-      // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-4]]:7: note: move occurred here
-      break;
-    }
-  }
-}
-
-// False positive: A use-after-move is flagged even though the "if (b)" and
-// "if (!b)" are mutually exclusive.
-void mutuallyExclusiveBranchesFalsePositive(bool b) {
-  A a;
-  if (b) {
-    std::move(a);
-  }
-  if (!b) {
-    a.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-5]]:5: note: move occurred here
-  }
-}
-
-// Destructors marked [[noreturn]] are handled correctly in the control flow
-// analysis. (These are used in some styles of assertion macros.)
-class FailureLogger {
-public:
-  FailureLogger();
-  [[noreturn]] ~FailureLogger();
-  void log(const char *);
-};
-#define ASSERT(x) \
-  while (x)       \
-  FailureLogger().log(#x)
-bool operationOnA(A);
-void noreturnDestructor() {
-  A a;
-  // The while loop in the ASSERT() would ordinarily have the potential to cause
-  // a use-after-move because the second iteration of the loop would be using a
-  // variable that had been moved from in the first iteration. Check that the
-  // CFG knows that the second iteration of the loop is never reached because
-  // the FailureLogger destructor is marked [[noreturn]].
-  ASSERT(operationOnA(std::move(a)));
-}
-#undef ASSERT
-
-////////////////////////////////////////////////////////////////////////////////
-// Tests for reinitializations
-
-template <class T>
-void swap(T &a, T &b) {
-  T tmp = std::move(a);
-  a = std::move(b);
-  b = std::move(tmp);
-}
-void assignments(int i) {
-  // Don't report a use-after-move if the variable was assigned to in the
-  // meantime.
-  {
-    A a;
-    std::move(a);
-    a = A();
-    a.foo();
-  }
-  // The assignment should also be recognized if move, assignment and use don't
-  // all happen in the same block (but the assignment is still guaranteed to
-  // prevent a use-after-move).
-  {
-    A a;
-    if (i == 1) {
-      std::move(a);
-      a = A();
-    }
-    if (i == 2) {
-      a.foo();
-    }
-  }
-  {
-    A a;
-    if (i == 1) {
-      std::move(a);
-    }
-    if (i == 2) {
-      a = A();
-      a.foo();
-    }
-  }
-  // The built-in assignment operator should also be recognized as a
-  // reinitialization. (std::move() may be called on built-in types in template
-  // code.)
-  {
-    int a1 = 1, a2 = 2;
-    swap(a1, a2);
-  }
-  // A std::move() after the assignment makes the variable invalid again.
-  {
-    A a;
-    std::move(a);
-    a = A();
-    std::move(a);
-    a.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // Report a use-after-move if we can't be sure that the variable was assigned
-  // to.
-  {
-    A a;
-    std::move(a);
-    if (i < 10) {
-      a = A();
-    }
-    if (i > 5) {
-      a.foo();
-      // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-7]]:5: note: move occurred here
-    }
-  }
-}
-
-// Passing the object to a function through a non-const pointer or reference
-// counts as a re-initialization.
-void passByNonConstPointer(A *);
-void passByNonConstReference(A &);
-void passByNonConstPointerIsReinit() {
-  {
-    A a;
-    std::move(a);
-    passByNonConstPointer(&a);
-    a.foo();
-  }
-  {
-    A a;
-    std::move(a);
-    passByNonConstReference(a);
-    a.foo();
-  }
-}
-
-// Passing the object through a const pointer or reference counts as a use --
-// since the called function cannot reinitialize the object.
-void passByConstPointer(const A *);
-void passByConstReference(const A &);
-void passByConstPointerIsUse() {
-  {
-    // Declaring 'a' as const so that no ImplicitCastExpr is inserted into the
-    // AST -- we wouldn't want the check to rely solely on that to detect a
-    // const pointer argument.
-    const A a;
-    std::move(a);
-    passByConstPointer(&a);
-    // CHECK-NOTES: [[@LINE-1]]:25: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  const A a;
-  std::move(a);
-  passByConstReference(a);
-  // CHECK-NOTES: [[@LINE-1]]:24: warning: 'a' used after it was moved
-  // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
-}
-
-// Clearing a standard container using clear() is treated as a
-// re-initialization.
-void standardContainerClearIsReinit() {
-  {
-    std::string container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::vector<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-
-    auto container2 = container;
-    std::move(container2);
-    container2.clear();
-    container2.empty();
-  }
-  {
-    std::deque<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::forward_list<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::list<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::set<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::map<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::multiset<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::multimap<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::unordered_set<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::unordered_map<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::unordered_multiset<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  {
-    std::unordered_multimap<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  // This should also work for typedefs of standard containers.
-  {
-    typedef std::vector<int> IntVector;
-    IntVector container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  // But it shouldn't work for non-standard containers.
-  {
-    // This might be called "vector", but it's not in namespace "std".
-    struct vector {
-      void clear() {}
-    } container;
-    std::move(container);
-    container.clear();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container' used after it was
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // An intervening clear() on a different container does not reinitialize.
-  {
-    std::vector<int> container1, container2;
-    std::move(container1);
-    container2.clear();
-    container1.empty();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container1' used after it was
-    // CHECK-NOTES: [[@LINE-4]]:5: note: move occurred here
-  }
-}
-
-// Clearing a standard container using assign() is treated as a
-// re-initialization.
-void standardContainerAssignIsReinit() {
-  {
-    std::string container;
-    std::move(container);
-    container.assign(0, ' ');
-    container.empty();
-  }
-  {
-    std::vector<int> container;
-    std::move(container);
-    container.assign(0, 0);
-    container.empty();
-  }
-  {
-    std::deque<int> container;
-    std::move(container);
-    container.assign(0, 0);
-    container.empty();
-  }
-  {
-    std::forward_list<int> container;
-    std::move(container);
-    container.assign(0, 0);
-    container.empty();
-  }
-  {
-    std::list<int> container;
-    std::move(container);
-    container.clear();
-    container.empty();
-  }
-  // But it doesn't work for non-standard containers.
-  {
-    // This might be called "vector", but it's not in namespace "std".
-    struct vector {
-      void assign(std::size_t, int) {}
-    } container;
-    std::move(container);
-    container.assign(0, 0);
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container' used after it was
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  // An intervening assign() on a different container does not reinitialize.
-  {
-    std::vector<int> container1, container2;
-    std::move(container1);
-    container2.assign(0, 0);
-    container1.empty();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container1' used after it was
-    // CHECK-NOTES: [[@LINE-4]]:5: note: move occurred here
-  }
-}
-
-// Resetting the standard smart pointer types using reset() is treated as a
-// re-initialization. (We don't test std::weak_ptr<> because it can't be
-// dereferenced directly.)
-void standardSmartPointerResetIsReinit() {
-  {
-    std::unique_ptr<A> ptr;
-    std::move(ptr);
-    ptr.reset(new A);
-    *ptr;
-  }
-  {
-    std::shared_ptr<A> ptr;
-    std::move(ptr);
-    ptr.reset(new A);
-    *ptr;
-  }
-}
-
-void reinitAnnotation() {
-  {
-    AnnotatedContainer<int> obj;
-    std::move(obj);
-    obj.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'obj' used after it was
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  {
-    AnnotatedContainer<int> obj;
-    std::move(obj);
-    obj.clear();
-    obj.foo();
-  }
-  {
-    // Calling clear() on a different object to the one that was moved is not
-    // considered a reinitialization.
-    AnnotatedContainer<int> obj1, obj2;
-    std::move(obj1);
-    obj2.clear();
-    obj1.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'obj1' used after it was
-    // CHECK-NOTES: [[@LINE-4]]:5: note: move occurred here
-  }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// Tests related to order of evaluation within expressions
-
-// Relative sequencing of move and use.
-void passByRvalueReference(int i, A &&a);
-void passByValue(int i, A a);
-void passByValue(A a, int i);
-A g(A, A &&);
-int intFromA(A &&);
-int intFromInt(int);
-void sequencingOfMoveAndUse() {
-  // This case is fine because the move only happens inside
-  // passByRvalueReference(). At this point, a.getInt() is guaranteed to have
-  // been evaluated.
-  {
-    A a;
-    passByRvalueReference(a.getInt(), std::move(a));
-  }
-  // However, if we pass by value, the move happens when the move constructor is
-  // called to create a temporary, and this happens before the call to
-  // passByValue(). Because the order in which arguments are evaluated isn't
-  // defined, the move may happen before the call to a.getInt().
-  //
-  // Check that we warn about a potential use-after move for both orderings of
-  // a.getInt() and std::move(a), independent of the order in which the
-  // arguments happen to get evaluated by the compiler.
-  {
-    A a;
-    passByValue(a.getInt(), std::move(a));
-    // CHECK-NOTES: [[@LINE-1]]:17: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:29: note: move occurred here
-    // CHECK-NOTES: [[@LINE-3]]:17: note: the use and move are unsequenced
-  }
-  {
-    A a;
-    passByValue(std::move(a), a.getInt());
-    // CHECK-NOTES: [[@LINE-1]]:31: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:17: note: move occurred here
-    // CHECK-NOTES: [[@LINE-3]]:31: note: the use and move are unsequenced
-  }
-  // An even more convoluted example.
-  {
-    A a;
-    g(g(a, std::move(a)), g(a, std::move(a)));
-    // CHECK-NOTES: [[@LINE-1]]:9: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:27: note: move occurred here
-    // CHECK-NOTES: [[@LINE-3]]:9: note: the use and move are unsequenced
-    // CHECK-NOTES: [[@LINE-4]]:29: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-5]]:7: note: move occurred here
-    // CHECK-NOTES: [[@LINE-6]]:29: note: the use and move are unsequenced
-  }
-  // This case is fine because the actual move only happens inside the call to
-  // operator=(). a.getInt(), by necessity, is evaluated before that call.
-  {
-    A a;
-    A vec[1];
-    vec[a.getInt()] = std::move(a);
-  }
-  // However, in the following case, the move happens before the assignment, and
-  // so the order of evaluation is not guaranteed.
-  {
-    A a;
-    int v[3];
-    v[a.getInt()] = intFromA(std::move(a));
-    // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:21: note: move occurred here
-    // CHECK-NOTES: [[@LINE-3]]:7: note: the use and move are unsequenced
-  }
-  {
-    A a;
-    int v[3];
-    v[intFromA(std::move(a))] = intFromInt(a.i);
-    // CHECK-NOTES: [[@LINE-1]]:44: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:7: note: move occurred here
-    // CHECK-NOTES: [[@LINE-3]]:44: note: the use and move are unsequenced
-  }
-}
-
-// Relative sequencing of move and reinitialization. If the two are unsequenced,
-// we conservatively assume that the move happens after the reinitialization,
-// i.e. the that object does not get reinitialized after the move.
-A MutateA(A a);
-void passByValue(A a1, A a2);
-void sequencingOfMoveAndReinit() {
-  // Move and reinitialization as function arguments (which are indeterminately
-  // sequenced). Again, check that we warn for both orderings.
-  {
-    A a;
-    passByValue(std::move(a), (a = A()));
-    a.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:17: note: move occurred here
-  }
-  {
-    A a;
-    passByValue((a = A()), std::move(a));
-    a.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:28: note: move occurred here
-  }
-  // Common usage pattern: Move the object to a function that mutates it in some
-  // way, then reassign the result to the object. This pattern is fine.
-  {
-    A a;
-    a = MutateA(std::move(a));
-    a.foo();
-  }
-}
-
-// Relative sequencing of reinitialization and use. If the two are unsequenced,
-// we conservatively assume that the reinitialization happens after the use,
-// i.e. that the object is not reinitialized at the point in time when it is
-// used.
-void sequencingOfReinitAndUse() {
-  // Reinitialization and use in function arguments. Again, check both possible
-  // orderings.
-  {
-    A a;
-    std::move(a);
-    passByValue(a.getInt(), (a = A()));
-    // CHECK-NOTES: [[@LINE-1]]:17: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-  {
-    A a;
-    std::move(a);
-    passByValue((a = A()), a.getInt());
-    // CHECK-NOTES: [[@LINE-1]]:28: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
-  }
-}
-
-// The comma operator sequences its operands.
-void commaOperatorSequences() {
-  {
-    A a;
-    A(std::move(a))
-    , (a = A());
-    a.foo();
-  }
-  {
-    A a;
-    (a = A()), A(std::move(a));
-    a.foo();
-    // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-3]]:16: note: move occurred here
-  }
-}
-
-// An initializer list sequences its initialization clauses.
-void initializerListSequences() {
-  {
-    struct S1 {
-      int i;
-      A a;
-    };
-    A a;
-    S1 s1{a.getInt(), std::move(a)};
-  }
-  {
-    struct S2 {
-      A a;
-      int i;
-    };
-    A a;
-    S2 s2{std::move(a), a.getInt()};
-    // CHECK-NOTES: [[@LINE-1]]:25: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:11: note: move occurred here
-  }
-}
-
-// A declaration statement containing multiple declarations sequences the
-// initializer expressions.
-void declarationSequences() {
-  {
-    A a;
-    A a1 = a, a2 = std::move(a);
-  }
-  {
-    A a;
-    A a1 = std::move(a), a2 = a;
-    // CHECK-NOTES: [[@LINE-1]]:31: warning: 'a' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:12: note: move occurred here
-  }
-}
-
-// The logical operators && and || sequence their operands.
-void logicalOperatorsSequence() {
-  {
-    A a;
-    if (a.getInt() > 0 && A(std::move(a)).getInt() > 0) {
-      A().foo();
-    }
-  }
-  // A variation: Negate the result of the && (which pushes the && further down
-  // into the AST).
-  {
-    A a;
-    if (!(a.getInt() > 0 && A(std::move(a)).getInt() > 0)) {
-      A().foo();
-    }
-  }
-  {
-    A a;
-    if (A(std::move(a)).getInt() > 0 && a.getInt() > 0) {
-      // CHECK-NOTES: [[@LINE-1]]:41: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-2]]:9: note: move occurred here
-      A().foo();
-    }
-  }
-  {
-    A a;
-    if (a.getInt() > 0 || A(std::move(a)).getInt() > 0) {
-      A().foo();
-    }
-  }
-  {
-    A a;
-    if (A(std::move(a)).getInt() > 0 || a.getInt() > 0) {
-      // CHECK-NOTES: [[@LINE-1]]:41: warning: 'a' used after it was moved
-      // CHECK-NOTES: [[@LINE-2]]:9: note: move occurred here
-      A().foo();
-    }
-  }
-}
-
-// A range-based for sequences the loop variable declaration before the body.
-void forRangeSequences() {
-  A v[2] = {A(), A()};
-  for (A &a : v) {
-    std::move(a);
-  }
-}
-
-// If a variable is declared in an if, while or switch statement, the init
-// statement (for if and switch) is sequenced before the variable declaration,
-// which in turn is sequenced before the evaluation of the condition. We place
-// all tests inside a for loop to ensure that the checker understands the
-// sequencing. If it didn't, then the loop would trigger the "moved twice"
-// logic.
-void ifWhileAndSwitchSequenceInitDeclAndCondition() {
-  for (int i = 0; i < 10; ++i) {
-    A a1;
-    if (A a2 = std::move(a1)) {
-      std::move(a2);
-    }
-  }
-  for (int i = 0; i < 10; ++i) {
-    A a1;
-    if (A a2 = std::move(a1); a2) {
-      std::move(a2);
-    }
-  }
-  for (int i = 0; i < 10; ++i) {
-    A a1;
-    if (A a2 = std::move(a1); A a3 = std::move(a2)) {
-      std::move(a3);
-    }
-  }
-  for (int i = 0; i < 10; ++i) {
-    // init followed by condition with move, but without variable declaration.
-    if (A a1; A(std::move(a1)).getInt() > 0) {}
-  }
-  for (int i = 0; i < 10; ++i) {
-    if (A a1; A(std::move(a1)).getInt() > a1.getInt()) {}
-    // CHECK-NOTES: [[@LINE-1]]:43: warning: 'a1' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:15: note: move occurred here
-    // CHECK-NOTES: [[@LINE-3]]:43: note: the use and move are unsequenced
-  }
-  for (int i = 0; i < 10; ++i) {
-    A a1;
-    if (A a2 = std::move(a1); A(a1) > 0) {}
-    // CHECK-NOTES: [[@LINE-1]]:33: warning: 'a1' used after it was moved
-    // CHECK-NOTES: [[@LINE-2]]:16: note: move occurred here
-  }
-  while (A a = A()) {
-    std::move(a);
-  }
-  for (int i = 0; i < 10; ++i) {
-    A a1;
-    switch (A a2 = std::move(a1); a2) {
-      case true:
-        std::move(a2);
-    }
-  }
-  for (int i = 0; i < 10; ++i) {
-    A a1;
-    switch (A a2 = a1; A a3 = std::move(a2)) {
-      case true:
-        std::move(a3);
-    }
-  }
-}
-
-// Some statements in templates (e.g. null, break and continue statements) may
-// be shared between the uninstantiated and instantiated versions of the
-// template and therefore have multiple parents. Make sure the sequencing code
-// handles this correctly.
-template <class> void nullStatementSequencesInTemplate() {
-  int c = 0;
-  (void)c;
-  ;
-  std::move(c);
-}
-template void nullStatementSequencesInTemplate<int>();
-
-namespace PR33020 {
-class D {
-  ~D();
-};
-struct A {
-  D d;
-};
-class B {
-  A a;
-};
-template <typename T>
-class C : T, B {
-  void m_fn1() {
-    int a;
-    std::move(a);
-    C c;
-  }
-};
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/bugprone-virtual-near-miss.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-virtual-near-miss.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-virtual-near-miss.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-virtual-near-miss.cpp (removed)
@@ -1,133 +0,0 @@
-// RUN: %check_clang_tidy %s bugprone-virtual-near-miss %t
-
-class NoDefinedClass1;
-class NoDefinedClass2;
-
-struct Base {
-  virtual void func();
-  virtual void gunk();
-  virtual ~Base();
-  virtual Base &operator=(const Base &);
-  virtual NoDefinedClass1 *f();
-};
-
-struct Derived : Base {
-  // Should not warn "do you want to override 'gunk'?", because gunk is already
-  // overriden by this class.
-  virtual void funk();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Derived::funk' has a similar name and the same signature as virtual method 'Base::func'; did you mean to override it? [bugprone-virtual-near-miss]
-  // CHECK-FIXES: virtual void func();
-
-  void func2();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Derived::func2' has {{.*}} 'Base::func'
-  // CHECK-FIXES: void func();
-
-  void func22(); // Should not warn.
-
-  void gunk(); // Should not warn: gunk is override.
-
-  void fun();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Derived::fun' has {{.*}} 'Base::func'
-  // CHECK-FIXES: void func();
-
-  Derived &operator==(const Base &); // Should not warn: operators are ignored.
-
-  virtual NoDefinedClass2 *f1(); // Should not crash: non-defined class return type is ignored.
-};
-
-template <typename T>
-struct TBase {
-  virtual void tfunc(T t);
-};
-
-template <typename T>
-struct TDerived : TBase<T> {
-  virtual void tfunk(T t);
-  // Should not apply fix for template.
-  // CHECK-MESSAGES: :[[@LINE-2]]:3: warning: method 'TDerived<double>::tfunk' has {{.*}} 'TBase<double>::tfunc'
-  // CHECK-MESSAGES: :[[@LINE-3]]:3: warning: method 'TDerived<int>::tfunk' has {{.*}} 'TBase<int>::tfunc'
-  // CHECK-FIXES: virtual void tfunk(T t);
-};
-
-TDerived<int> T1;
-TDerived<double> T2;
-
-// Should not fix macro definition
-#define MACRO1 void funcM()
-// CHECK-FIXES: #define MACRO1 void funcM()
-#define MACRO2(m) void m()
-// CHECK-FIXES: #define MACRO2(m) void m()
-
-struct DerivedMacro : Base {
-  MACRO1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'DerivedMacro::funcM' has {{.*}} 'Base::func'
-  // CHECK-FIXES: MACRO1;
-
-  MACRO2(func3);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'DerivedMacro::func3' has {{.*}} 'Base::func'
-  // CHECK-FIXES: MACRO2(func);
-};
-
-typedef Derived derived_type;
-
-class Father {
-public:
-  Father();
-  virtual void func();
-  virtual Father *create(int i);
-  virtual Base &&generate();
-  virtual Base *canonical(Derived D);
-};
-
-class Mother {
-public:
-  Mother();
-  static void method();
-  virtual int method(int argc, const char **argv);
-  virtual int method(int argc) const;
-  virtual int decay(const char *str);
-};
-
-class Child : private Father, private Mother {
-public:
-  Child();
-
-  virtual void func2();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::func2' has {{.*}} 'Father::func'
-  // CHECK-FIXES: virtual void func();
-
-  int methoe(int x, char **strs); // Should not warn: parameter types don't match.
-
-  int methoe(int x);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::methoe' has {{.*}} 'Mother::method'
-  // CHECK-FIXES: int method(int x);
-
-  void methof(int x, const char **strs); // Should not warn: return types don't match.
-
-  int methoh(int x, const char **strs);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::methoh' has {{.*}} 'Mother::method'
-  // CHECK-FIXES: int method(int x, const char **strs);
-
-  virtual Child *creat(int i);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::creat' has {{.*}} 'Father::create'
-  // CHECK-FIXES: virtual Child *create(int i);
-
-  virtual Derived &&generat();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::generat' has {{.*}} 'Father::generate'
-  // CHECK-FIXES: virtual Derived &&generate();
-
-  int decaz(const char str[]);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::decaz' has {{.*}} 'Mother::decay'
-  // CHECK-FIXES: int decay(const char str[]);
-
-  operator bool();
-
-  derived_type *canonica(derived_type D);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::canonica' has {{.*}} 'Father::canonical'
-  // CHECK-FIXES: derived_type *canonical(derived_type D);
-
-private:
-  void funk();
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: method 'Child::funk' has {{.*}} 'Father::func'
-  // CHECK-FIXES: void func();
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-dcl21-cpp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-dcl21-cpp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-dcl21-cpp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-dcl21-cpp.cpp (removed)
@@ -1,134 +0,0 @@
-// RUN: %check_clang_tidy %s cert-dcl21-cpp %t
-
-class A {};
-
-A operator++(A &, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator++' returns a non-constant object instead of a constant object type [cert-dcl21-cpp]
-// CHECK-FIXES: {{^}}const A operator++(A &, int);
-
-A operator--(A &, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator--' returns a no
-// CHECK-FIXES: {{^}}const A operator--(A &, int);
-
-class B {};
-
-B &operator++(B &);
-const B operator++(B &, int);
-
-B &operator--(B &);
-const B operator--(B &, int);
-
-
-class D {
-D &operator++();
-const D operator++(int);
-
-D &operator--();
-const D operator--(int);
-};
-
-class C {
-C operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator++' returns a no
-// CHECK-FIXES: {{^}}const C operator++(int);
-
-C operator--(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator--' returns a no
-// CHECK-FIXES: {{^}}const C operator--(int);
-};
-
-class E {};
-
-E &operator++(E &, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator++' returns a reference instead of a constant object type [cert-dcl21-cpp]
-// CHECK-FIXES: {{^}}const E operator++(E &, int);
-
-E &operator--(E &, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator--' returns a re
-// CHECK-FIXES: {{^}}const E operator--(E &, int);
-
-class G {
-G &operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}const G operator++(int);
-
-G &operator--(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator--' returns a re
-// CHECK-FIXES: {{^}}const G operator--(int);
-};
-
-class F {};
-
-const F &operator++(F &, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}const F operator++(F &, int);
-
-const F &operator--(F &, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator--' returns a re
-// CHECK-FIXES: {{^}}const F operator--(F &, int);
-
-class H {
-const H &operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}const H operator++(int);
-
-const H &operator--(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator--' returns a re
-// CHECK-FIXES: {{^}}const H operator--(int);
-};
-
-
-#define FROM_MACRO P&
-class P {
-const FROM_MACRO operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}const FROM_MACRO operator++(int);
-};
-
-
-template<typename T>
-class Q {
-const Q &operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}const Q<T> operator++(int);
-
-const Q &operator--(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: overloaded 'operator--' returns a re
-// CHECK-FIXES: {{^}}const Q<T> operator--(int);
-};
-
-void foobar() {
-  Q<int> a;
-  Q<float> b;
-  (void)a;
-  (void)b;
-}
-
-struct S {};
-typedef S& SRef;
-
-SRef operator++(SRef, int);
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}SRef operator++(SRef, int);
-
-struct T {
-  typedef T& TRef;
-  
-  TRef operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}  TRef operator++(int);
-};
-
-struct U {
-  typedef const U& ConstURef;
-  
-  ConstURef& operator++(int);
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: overloaded 'operator++' returns a re
-// CHECK-FIXES: {{^}}  ConstURef& operator++(int);
-};
-
-struct V {
-  V *operator++(int);
-  V *const operator--(int);
-};
-

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-dcl58-cpp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-dcl58-cpp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-dcl58-cpp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-dcl58-cpp.cpp (removed)
@@ -1,67 +0,0 @@
-// RUN: %check_clang_tidy %s cert-dcl58-cpp %t -- -- -std=c++1z -I %S/Inputs/Headers
-
-#include "system-header-simulation.h"
-
-namespace A {
-  namespace B {
-    int b;
-  }
-}
-
-namespace A {
-  namespace B {
-    int c;
-  }
-}
-
-namespace posix {
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: modification of 'posix' namespace can result in undefined behavior [cert-dcl58-cpp]
-  namespace vmi {
-  }
-}
-
-namespace std {
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: modification of 'std' namespace can
-  int stdInt;
-}
-
-namespace foobar {
-  namespace std {
-    int bar;
-  }
-}
-
-namespace posix::a {
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: modification of 'posix' namespace 
-}
-
-enum class MyError {
-  ErrorA,
-  ErrorB
-};
-
-namespace std {
-template <>
-struct is_error_code_enum<MyError> : std::true_type {};
-
-template<>
-void swap<MyError>(MyError &a, MyError &b);
-}
-
-enum class MyError2 {
-  Error2A,
-  Error2B
-};
-
-namespace std {
-// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: modification of 'std' namespace 
-template <>
-struct is_error_code_enum<MyError2> : std::true_type {};
-
-int foobar;
-}
-
-using namespace std;
-
-int x;
-

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-env33-c.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-env33-c.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-env33-c.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-env33-c.c (removed)
@@ -1,20 +0,0 @@
-// RUN: %check_clang_tidy %s cert-env33-c %t
-
-typedef struct FILE {} FILE;
-
-extern int system(const char *);
-extern FILE *popen(const char *, const char *);
-extern FILE *_popen(const char *, const char *);
-
-void f(void) {
-  // It is permissible to check for the presence of a command processor.
-  system(0);
-
-  system("test");
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling 'system' uses a command processor [cert-env33-c]
-
-  popen("test", "test");
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling 'popen' uses a command processor
-  _popen("test", "test");
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling '_popen' uses a command processor
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.c (removed)
@@ -1,103 +0,0 @@
-// RUN: %check_clang_tidy %s cert-err34-c %t -- -- -std=c11
-
-typedef __SIZE_TYPE__      size_t;
-typedef signed             ptrdiff_t;
-typedef long long          intmax_t;
-typedef unsigned long long uintmax_t;
-typedef void *             FILE;
-
-extern FILE *stdin;
-
-extern int fscanf(FILE * restrict stream, const char * restrict format, ...);
-extern int scanf(const char * restrict format, ...);
-extern int sscanf(const char * restrict s, const char * restrict format, ...);
-
-extern double atof(const char *nptr);
-extern int atoi(const char *nptr);
-extern long int atol(const char *nptr);
-extern long long int atoll(const char *nptr);
-
-void f1(const char *in) {
-  int i;
-  long long ll;
-  unsigned int ui;
-  unsigned long long ull;
-  intmax_t im;
-  uintmax_t uim;
-  float f;
-  double d;
-  long double ld;
-
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'sscanf' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead [cert-err34-c]
-  sscanf(in, "%d", &i);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'fscanf' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtoll' instead [cert-err34-c]
-  fscanf(stdin, "%lld", &ll);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'sscanf' used to convert a string to an unsigned integer value, but function will not report conversion errors; consider using 'strtoul' instead [cert-err34-c]
-  sscanf(in, "%u", &ui);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'fscanf' used to convert a string to an unsigned integer value, but function will not report conversion errors; consider using 'strtoull' instead [cert-err34-c]
-  fscanf(stdin, "%llu", &ull);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtoimax' instead [cert-err34-c]
-  scanf("%jd", &im);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'fscanf' used to convert a string to an unsigned integer value, but function will not report conversion errors; consider using 'strtoumax' instead [cert-err34-c]
-  fscanf(stdin, "%ju", &uim);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'sscanf' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtof' instead [cert-err34-c]
-  sscanf(in, "%f", &f); // to float
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'fscanf' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtod' instead [cert-err34-c]
-  fscanf(stdin, "%lg", &d);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'sscanf' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtold' instead [cert-err34-c]
-  sscanf(in, "%Le", &ld);
-
-  // These are conversions with other modifiers
-  short s;
-  char c;
-  size_t st;
-  ptrdiff_t pt;
-
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%hhd", &c);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%hd", &s);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%zu", &st);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%td", &pt);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%o", ui);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%X", ui);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%x", ui);
-}
-
-void f2(const char *in) {
-  // CHECK-MESSAGES: :[[@LINE+1]]:11: warning: 'atoi' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead [cert-err34-c]
-  int i = atoi(in); // to int
-  // CHECK-MESSAGES: :[[@LINE+1]]:12: warning: 'atol' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead [cert-err34-c]
-  long l = atol(in); // to long
-  // CHECK-MESSAGES: :[[@LINE+1]]:18: warning: 'atoll' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtoll' instead [cert-err34-c]
-  long long ll = atoll(in); // to long long
-  // CHECK-MESSAGES: :[[@LINE+1]]:14: warning: 'atof' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtod' instead [cert-err34-c]
-  double d = atof(in); // to double
-}
-
-void f3(void) {
-  int i;
-  unsigned int u;
-  float f;
-  char str[32];
-
-  // Test that we don't report multiple infractions for a single call.
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%d%u%f", &i, &u, &f);
-
-  // Test that we still catch infractions that are not the first specifier.
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'scanf' used to convert
-  scanf("%s%d", str, &i);
-}
-
-void do_not_diagnose(void) {
-  char str[32];
-
-  scanf("%s", str); // Not a numerical conversion
-  scanf("%*d"); // Assignment suppressed
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-err34-c.cpp (removed)
@@ -1,43 +0,0 @@
-// RUN: %check_clang_tidy %s cert-err34-c %t
-
-typedef void *             FILE;
-
-extern FILE *stdin;
-
-extern int fscanf(FILE * stream, const char * format, ...);
-extern int sscanf(const char * s, const char * format, ...);
-
-extern double atof(const char *nptr);
-extern int atoi(const char *nptr);
-extern long int atol(const char *nptr);
-extern long long int atoll(const char *nptr);
-
-namespace std {
-using ::FILE; using ::stdin;
-using ::fscanf; using ::sscanf;
-using ::atof; using ::atoi; using ::atol; using ::atoll;
-}
-
-void f1(const char *in) {
-  int i;
-  long long ll;
-
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'sscanf' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead [cert-err34-c]
-  std::sscanf(in, "%d", &i);
-  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: 'fscanf' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtoll' instead [cert-err34-c]
-  std::fscanf(std::stdin, "%lld", &ll);
-}
-
-void f2(const char *in) {
-  // CHECK-MESSAGES: :[[@LINE+1]]:11: warning: 'atoi' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead [cert-err34-c]
-  int i = std::atoi(in); // to int
-  // CHECK-MESSAGES: :[[@LINE+1]]:12: warning: 'atol' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead [cert-err34-c]
-  long l = std::atol(in); // to long
-
-  using namespace std;
-
-  // CHECK-MESSAGES: :[[@LINE+1]]:18: warning: 'atoll' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtoll' instead [cert-err34-c]
-  long long ll = atoll(in); // to long long
-  // CHECK-MESSAGES: :[[@LINE+1]]:14: warning: 'atof' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtod' instead [cert-err34-c]
-  double d = atof(in); // to double
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-flp30-c.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-flp30-c.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-flp30-c.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-flp30-c.c (removed)
@@ -1,19 +0,0 @@
-// RUN: %check_clang_tidy %s cert-flp30-c %t
-
-float g(void);
-
-void func(void) {
-  for (float x = 0.1f; x <= 1.0f; x += 0.1f) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: loop induction expression should not have floating-point type [cert-flp30-c]
-
-  float f = 1.0f;
-  for (; f > 0; --f) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: loop induction expression
-
-  for (;;g()) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: loop induction expression
-
-  for (int i = 0; i < 10; i += 1.0f) {}
-
-  for (int i = 0; i < 10; ++i) {}
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.c (removed)
@@ -1,13 +0,0 @@
-// RUN: %check_clang_tidy %s cert-msc30-c %t
-
-extern int rand(void);
-int nonrand();
-
-int cTest() {
-  int i = rand();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness [cert-msc30-c]
-
-  int k = nonrand();
-
-  return 0;
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-limited-randomness.cpp (removed)
@@ -1,28 +0,0 @@
-// RUN: %check_clang_tidy %s cert-msc50-cpp %t
-
-int rand();
-int rand(int);
-
-namespace std {
-using ::rand;
-}
-
-namespace nonstd {
-  int rand();
-}
-
-void testFunction1() {
-  int i = std::rand();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness; use C++11 random library instead [cert-msc50-cpp]
-
-  int j = ::rand();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness; use C++11 random library instead [cert-msc50-cpp]
-
-  int k = rand(i);
-
-  int l = nonstd::rand();
-
-  int m = rand();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness; use C++11 random library instead [cert-msc50-cpp]
-}
-

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-msc32-c.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-msc32-c.c?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-msc32-c.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-msc32-c.c (removed)
@@ -1,27 +0,0 @@
-// RUN: %check_clang_tidy %s cert-msc32-c %t -- -config="{CheckOptions: [{key: cert-msc32-c.DisallowedSeedTypes, value: 'some_type,time_t'}]}" -- -std=c99
-
-void srand(int seed);
-typedef int time_t;
-time_t time(time_t *t);
-
-void f() {
-  srand(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc32-c]
-
-  const int a = 1;
-  srand(a);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc32-c]
-
-  time_t t;
-  srand(time(&t)); // Disallowed seed type
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc32-c]
-}
-
-void g() {
-  typedef int user_t;
-  user_t a = 1;
-  srand(a);
-
-  int b = 1;
-  srand(b); // Can not evaluate as int
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-msc51-cpp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-msc51-cpp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-msc51-cpp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-msc51-cpp.cpp (removed)
@@ -1,211 +0,0 @@
-// RUN: %check_clang_tidy %s cert-msc51-cpp %t -- \
-// RUN:     -config="{CheckOptions: [{key: cert-msc51-cpp.DisallowedSeedTypes, value: 'some_type,time_t'}]}"
-
-namespace std {
-
-void srand(int seed);
-
-template <class UIntType, UIntType a, UIntType c, UIntType m>
-struct linear_congruential_engine {
-  linear_congruential_engine(int _ = 0);
-  void seed(int _ = 0);
-};
-using default_random_engine = linear_congruential_engine<unsigned int, 1, 2, 3>;
-
-using size_t = int;
-template <class UIntType, size_t w, size_t n, size_t m, size_t r,
-          UIntType a, size_t u, UIntType d, size_t s,
-          UIntType b, size_t t,
-          UIntType c, size_t l, UIntType f>
-struct mersenne_twister_engine {
-  mersenne_twister_engine(int _ = 0);
-  void seed(int _ = 0);
-};
-using mt19937 = mersenne_twister_engine<unsigned int, 32, 624, 397, 21, 0x9908b0df, 11, 0xffffffff, 7, 0x9d2c5680, 15, 0xefc60000, 18, 1812433253>;
-
-template <class UIntType, size_t w, size_t s, size_t r>
-struct subtract_with_carry_engine {
-  subtract_with_carry_engine(int _ = 0);
-  void seed(int _ = 0);
-};
-using ranlux24_base = subtract_with_carry_engine<unsigned int, 24, 10, 24>;
-
-template <class Engine, size_t p, size_t r>
-struct discard_block_engine {
-  discard_block_engine();
-  discard_block_engine(int _);
-  void seed();
-  void seed(int _);
-};
-using ranlux24 = discard_block_engine<ranlux24_base, 223, 23>;
-
-template <class Engine, size_t w, class UIntType>
-struct independent_bits_engine {
-  independent_bits_engine();
-  independent_bits_engine(int _);
-  void seed();
-  void seed(int _);
-};
-using independent_bits = independent_bits_engine<ranlux24_base, 223, int>;
-
-template <class Engine, size_t k>
-struct shuffle_order_engine {
-  shuffle_order_engine();
-  shuffle_order_engine(int _);
-  void seed();
-  void seed(int _);
-};
-using shuffle_order = shuffle_order_engine<ranlux24_base, 223>;
-
-struct random_device {
-  random_device();
-  int operator()();
-};
-} // namespace std
-
-using time_t = unsigned int;
-time_t time(time_t *t);
-
-void f() {
-  const int seed = 2;
-  time_t t;
-
-  std::srand(0);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::srand(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::srand(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-
-  // One instantiation for every engine
-  std::default_random_engine engine1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  std::default_random_engine engine2(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::default_random_engine engine3(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::default_random_engine engine4(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine1.seed();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  engine1.seed(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine1.seed(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine1.seed(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-
-  std::mt19937 engine5;
-  // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  std::mt19937 engine6(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::mt19937 engine7(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::mt19937 engine8(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine5.seed();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  engine5.seed(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine5.seed(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine5.seed(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-
-  std::ranlux24_base engine9;
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  std::ranlux24_base engine10(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::ranlux24_base engine11(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::ranlux24_base engine12(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine9.seed();
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  engine9.seed(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine9.seed(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine9.seed(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-
-  std::ranlux24 engine13;
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  std::ranlux24 engine14(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::ranlux24 engine15(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::ranlux24 engine16(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine13.seed();
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  engine13.seed(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine13.seed(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine13.seed(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-
-  std::independent_bits engine17;
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  std::independent_bits engine18(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::independent_bits engine19(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::independent_bits engine20(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine17.seed();
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  engine17.seed(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine17.seed(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine17.seed(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-
-  std::shuffle_order engine21;
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  std::shuffle_order engine22(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::shuffle_order engine23(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  std::shuffle_order engine24(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine21.seed();
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a default argument will generate a predictable sequence of values [cert-msc51-cpp]
-  engine21.seed(1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine21.seed(seed);
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a constant value will generate a predictable sequence of values [cert-msc51-cpp]
-  engine21.seed(time(&t));
-  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: random number generator seeded with a disallowed source of seed value will generate a predictable sequence of values [cert-msc51-cpp]
-}
-
-struct A {
-  A(int _ = 0);
-  void seed(int _ = 0);
-};
-
-void g() {
-  int n = 1;
-  std::default_random_engine engine1(n);
-  std::mt19937 engine2(n);
-  std::ranlux24_base engine3(n);
-  std::ranlux24 engine4(n);
-  std::independent_bits engine5(n);
-  std::shuffle_order engine6(n);
-
-  std::random_device dev;
-  std::default_random_engine engine7(dev());
-  std::mt19937 engine8(dev());
-  std::ranlux24_base engine9(dev());
-  std::ranlux24 engine10(dev());
-  std::independent_bits engine11(dev());
-  std::shuffle_order engine12(dev());
-
-  A a1;
-  A a2(1);
-  a1.seed();
-  a1.seed(1);
-  a1.seed(n);
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-oop11-cpp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-oop11-cpp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-oop11-cpp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-oop11-cpp.cpp (removed)
@@ -1,21 +0,0 @@
-// RUN: %check_clang_tidy %s cert-oop11-cpp %t
-
-struct B {
-  B(B&&) noexcept = default;
-
-  B(const B &) = default;
-  B& operator=(const B&) = default;
-  ~B() {}
-};
-
-struct D {
-  B b;
-
-  // CHECK-MESSAGES: :[[@LINE+1]]:14: warning: move constructor initializes class member by calling a copy constructor [cert-oop11-cpp]
-  D(D &&d) : b(d.b) {}
-
-  // This should not produce a diagnostic because it is not covered under
-  // the CERT guideline for OOP11-CPP. However, this will produce a diagnostic
-  // under performance-move-constructor-init.
-  D(B b) : b(b) {}
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-oop54-cpp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-oop54-cpp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-oop54-cpp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-oop54-cpp.cpp (removed)
@@ -1,16 +0,0 @@
-// RUN: %check_clang_tidy %s cert-oop54-cpp %t
-
-// Test whether bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField option is set correctly.
-class TrivialFields {
-public:
-  TrivialFields &operator=(const TrivialFields &object) {
-    // CHECK-MESSAGES: [[@LINE-1]]:18: warning: operator=() does not handle self-assignment properly [cert-oop54-cpp]
-    return *this;
-  }
-
-private:
-  int m;
-  float f;
-  double d;
-  bool b;
-};

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-setlongjmp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-setlongjmp.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-setlongjmp.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-setlongjmp.cpp (removed)
@@ -1,26 +0,0 @@
-// RUN: %check_clang_tidy %s cert-err52-cpp %t
-
-typedef void *jmp_buf;
-extern int __setjmpimpl(jmp_buf);
-#define setjmp(x) __setjmpimpl(x)
-[[noreturn]] extern void longjmp(jmp_buf, int);
-
-namespace std {
-using ::jmp_buf;
-using ::longjmp;
-}
-
-static jmp_buf env;
-void g() {
-  std::longjmp(env, 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not call 'longjmp'; consider using exception handling instead [cert-err52-cpp]
-  ::longjmp(env, 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not call 'longjmp'; consider using exception handling instead
-  longjmp(env, 1);
-  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not call 'longjmp'; consider using exception handling instead
-}
-
-void f() {
-  (void)setjmp(env);
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: do not call 'setjmp'; consider using exception handling instead
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-static-object-exception.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-static-object-exception.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-static-object-exception.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-static-object-exception.cpp (removed)
@@ -1,275 +0,0 @@
-// RUN: clang-tidy %s -checks="-*,cert-err58-cpp" -- -std=c++17 -target x86_64-pc-linux-gnu \
-// RUN:   | FileCheck %s -check-prefix=CHECK-EXCEPTIONS \
-// RUN:   -implicit-check-not="{{warning|error}}:"
-// RUN: clang-tidy %s -checks="-*,cert-err58-cpp" -- -DNONEXCEPTIONS -fno-exceptions -std=c++17 -target x86_64-pc-linux-gnu \
-// RUN:   | FileCheck %s -allow-empty -check-prefix=CHECK-NONEXCEPTIONS \
-// RUN:   -implicit-check-not="{{warning|error}}:"
-
-struct S {
-  S() noexcept(false);
-};
-
-struct T {
-  T() noexcept;
-};
-
-struct U {
-  U() {}
-};
-
-struct V {
-  explicit V(const char *) {} // Can throw
-};
-
-struct Cleanup {
-  ~Cleanup() {}
-};
-
-struct W {
-  W(Cleanup c = {}) noexcept(false);
-};
-
-struct X {
-  X(S = {}) noexcept;
-};
-
-struct Y {
-  S s;
-};
-
-struct Z {
-  T t;
-};
-
-int f();
-int g() noexcept(false);
-int h() noexcept(true);
-
-struct UserConv_Bad {
-  operator int() noexcept(false);
-};
-
-struct UserConv_Good {
-  operator int() noexcept;
-};
-
-UserConv_Bad some_bad_func() noexcept;
-UserConv_Good some_good_func() noexcept;
-
-S s;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 's' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: 9:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-T t; // ok
-U u;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'u' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 17:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-V v("v");
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'v' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 21:12: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-W w;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'w' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 29:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-X x1(S{});
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'x1' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 9:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-X x2;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'x2' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 9:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-Y y;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'y' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 36:8: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-Z z;
-
-int i = f();
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:5: warning: initialization of 'i' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 44:5: note: possibly throwing function declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-int j = g();
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:5: warning: initialization of 'j' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 45:5: note: possibly throwing function declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-int k = h();
-int l = some_bad_func();
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:5: warning: initialization of 'l' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 49:3: note: possibly throwing function declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-int m = some_good_func();
-
-typedef decltype(sizeof(int)) size_t;
-inline void *operator new(size_t sz, void *here) noexcept { return here; }
-char n[sizeof(int)];
-int *o = new (n) int();
-int *p = new int();
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:6: warning: initialization of 'p' with static storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-
-thread_local S s3;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 's3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-thread_local T t3; // ok
-thread_local U u3;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 'u3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-thread_local V v3("v");
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 'v3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-thread_local W w3;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 'w3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-
-void f(S s1, T t1, U u1, V v1, W w1) { // ok, ok, ok, ok, ok
-  S s2; // ok
-  T t2; // ok
-  U u2; // ok
-  V v2("v"); // ok
-  W w2; // ok
-
-  thread_local S s3; // ok
-  thread_local T t3; // ok
-  thread_local U u3; // ok
-  thread_local V v3("v"); // ok
-  thread_local W w3; // ok
-
-  static S s4; // ok
-  static T t4; // ok
-  static U u4; // ok
-  static V v4("v"); // ok
-  static W w4; // ok
-}
-
-namespace {
-S s;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 's' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: 9:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-T t; // ok
-U u;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'u' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 17:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-V v("v");
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'v' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 21:12: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-W w;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:3: warning: initialization of 'w' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 29:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-
-thread_local S s3;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 's3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-thread_local T t3; // ok
-thread_local U u3;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 'u3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-thread_local V v3("v");
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 'v3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-thread_local W w3;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:16: warning: initialization of 'w3' with thread_local storage duration may throw an exception that cannot be caught
-// CHECK-NONEXCEPTIONS-NOT: warning:
-}; // namespace
-
-class Statics {
-  static S s; // warn when initialized
-  static T t; // ok
-  static U u; // warn when initialized
-  static V v; // warn when initialized
-  static W w; // warn when initialized
-
-  void f(S s, T t, U u, V v) {
-    S s2;      // ok
-    T t2;      // ok
-    U u2;      // ok
-    V v2("v"); // ok
-    W w2;      // ok
-
-    thread_local S s3;      // ok
-    thread_local T t3;      // ok
-    thread_local U u3;      // ok
-    thread_local V v3("v"); // ok
-    thread_local W w3;      // ok
-
-    static S s4;      // ok
-    static T t4;      // ok
-    static U u4;      // ok
-    static V v4("v"); // ok
-    static W w4;      // ok
-  }
-};
-
-S Statics::s;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:12: warning: initialization of 's' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: 9:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-T Statics::t;
-U Statics::u;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:12: warning: initialization of 'u' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 17:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-V Statics::v("v");
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:12: warning: initialization of 'v' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 21:12: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-W Statics::w;
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:12: warning: initialization of 'w' with static storage duration may throw an exception that cannot be caught
-// CHECK-EXCEPTIONS: 29:3: note: possibly throwing constructor declared here
-// CHECK-NONEXCEPTIONS-NOT: warning:
-
-#ifndef NONEXCEPTIONS
-namespace pr35457 {
-constexpr int foo(int x) { if (x <= 0) throw 12; return x; }
-
-constexpr int bar = foo(1); // OK
-// CHECK-EXCEPTIONS-NOT: warning: initialization of 'bar' with static storage
-int baz = foo(0); // Not OK; throws at runtime when exceptions are enabled.
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:5: warning: initialization of 'baz' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: :[[@LINE-6]]:15: note: possibly throwing function declared here
-} // namespace pr35457
-#endif // NONEXCEPTIONS
-
-namespace pr39777 {
-struct S { S(); };
-struct T { T() noexcept; };
-
-auto Okay1 = []{ S s; };
-auto Okay2 = []{ (void)new int; };
-auto NotOkay1 = []{ S s; return 12; }(); // Because the lambda call is not noexcept
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:6: warning: initialization of 'NotOkay1' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: :[[@LINE-7]]:12: note: possibly throwing constructor declared here
-auto NotOkay2 = []() noexcept { S s; return 12; }(); // Because S::S() is not noexcept
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:6: warning: initialization of 'NotOkay2' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: :[[@LINE-10]]:12: note: possibly throwing constructor declared here
-auto Okay3 = []() noexcept { T t; return t; }();
-
-struct U {
-  U() noexcept;
-  auto getBadLambda() const noexcept {
-    return []{ S s; return s; };
-  }
-};
-auto Okay4 = []{ U u; return u.getBadLambda(); }();
-auto NotOkay3 = []() noexcept { U u; return u.getBadLambda(); }()(); // Because the lambda returned and called is not noexcept
-// CHECK-EXCEPTIONS: :[[@LINE-1]]:6: warning: initialization of 'NotOkay3' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
-// CHECK-EXCEPTIONS: :[[@LINE-6]]:12: note: possibly throwing function declared here
-
-#ifndef NONEXCEPTIONS
-struct Bad {
-  Bad() {
-    throw 12;
-  }
-};
-
-static auto NotOkay4 = [bad = Bad{}](){};
-// FIXME: the above should be diagnosed because the capture init can trigger
-// an exception when constructing the Bad object.
-#endif // NONEXCEPTIONS
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-throw-exception-type.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-throw-exception-type.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-throw-exception-type.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-throw-exception-type.cpp (removed)
@@ -1,129 +0,0 @@
-// RUN: %check_clang_tidy -std=c++11,c++14 %s cert-err60-cpp %t -- -- -fcxx-exceptions
-// FIXME: Split off parts of this test that rely on dynamic exeption
-// specifications, and run this test in all language modes.
-
-struct S {};
-struct T : S {};
-struct U {
-  U() = default;
-  U(const U&) = default;
-};
-
-struct V {
-  V() = default;
-  V(const V&) noexcept;
-};
-
-struct W {
-  W() = default;
-  W(const W&) noexcept(false);
-};
-
-struct X {
-  X() = default;
-  X(const X&) {}
-};
-
-struct Y {
-  Y() = default;
-  Y(const Y&) throw();
-};
-
-struct Z {
-  Z() = default;
-  Z(const Z&) throw(int);
-};
-
-void g() noexcept(false);
-
-struct A {
-  A() = default;
-  A(const A&) noexcept(noexcept(g()));
-};
-
-struct B {
-  B() = default;
-  B(const B&) = default;
-  B(const A&) noexcept(false);
-};
-
-class C {
-  W M; // W is not no-throw copy constructible
-public:
-  C() = default;
-  C(const C&) = default;
-};
-
-struct D {
-  D() = default;
-  D(const D&) noexcept(false);
-  D(D&) noexcept(true);
-};
-
-struct E {
-  E() = default;
-  E(E&) noexcept(true);
-  E(const E&) noexcept(false);
-};
-
-struct Allocates {
-  int *x;
-  Allocates() : x(new int(0)) {}
-  Allocates(const Allocates &other) : x(new int(*other.x)) {}
-};
-
-struct OptionallyAllocates {
-  int *x;
-  OptionallyAllocates() : x(new int(0)) {}
-  OptionallyAllocates(const Allocates &other) noexcept(true) {
-    try {
-      x = new int(*other.x);
-    } catch (...) {
-      x = nullptr;
-    }
-  }
-};
-
-void f() {
-  throw 12; // ok
-  throw "test"; // ok
-  throw S(); // ok
-  throw T(); // ok
-  throw U(); // ok
-  throw V(); // ok
-  throw W(); // match, noexcept(false)
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible [cert-err60-cpp]
-  throw X(); // match, no noexcept clause, nontrivial
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw Y(); // ok
-  throw Z(); // match, throw(int)
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw A(); // match, noexcept(false)
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw B(); // ok
-  throw C(); // match, C has a member variable that makes it throwing on copy
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw D(); // match, has throwing copy constructor
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw E(); // match, has throwing copy constructor
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw Allocates(); // match, copy constructor throws
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: thrown exception type is not nothrow copy constructible
-  throw OptionallyAllocates(); // ok
-}
-
-namespace PR25574 {
-struct B {
-  B(const B&) noexcept;
-};
-
-struct D : B {
-  D();
-  virtual ~D() noexcept;
-};
-
-template <typename T>
-void f() {
-  throw D();
-}
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-uppercase-literal-suffix-integer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-uppercase-literal-suffix-integer.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-uppercase-literal-suffix-integer.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-uppercase-literal-suffix-integer.cpp (removed)
@@ -1,159 +0,0 @@
-// RUN: %check_clang_tidy %s cert-dcl16-c %t -- -- -I %S
-// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
-// RUN: clang-tidy %t.cpp -checks='-*,cert-dcl16-c' -fix -- -I %S
-// RUN: clang-tidy %t.cpp -checks='-*,cert-dcl16-c' -warnings-as-errors='-*,cert-dcl16-c' -- -I %S
-
-#include "readability-uppercase-literal-suffix.h"
-
-void integer_suffix() {
-  static constexpr auto v0 = __LINE__; // synthetic
-  static_assert(v0 == 9 || v0 == 5, "");
-
-  static constexpr auto v1 = __cplusplus; // synthetic, long
-
-  static constexpr auto v2 = 1; // no literal
-  static_assert(is_same<decltype(v2), const int>::value, "");
-  static_assert(v2 == 1, "");
-
-  // Unsigned
-
-  static constexpr auto v3 = 1u;
-  static_assert(is_same<decltype(v3), const unsigned int>::value, "");
-  static_assert(v3 == 1, "");
-
-  static constexpr auto v4 = 1U; // OK.
-  static_assert(is_same<decltype(v4), const unsigned int>::value, "");
-  static_assert(v4 == 1, "");
-
-  // Long
-
-  static constexpr auto v5 = 1l;
-  // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'l', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1l;
-  // CHECK-MESSAGES-NEXT: ^~
-  // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}}
-  // CHECK-FIXES: static constexpr auto v5 = 1L;
-  static_assert(is_same<decltype(v5), const long>::value, "");
-  static_assert(v5 == 1, "");
-
-  static constexpr auto v6 = 1L; // OK.
-  static_assert(is_same<decltype(v6), const long>::value, "");
-  static_assert(v6 == 1, "");
-
-  // Long Long
-
-  static constexpr auto v7 = 1ll;
-  // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'll', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 1ll;
-  // CHECK-MESSAGES-NEXT: ^~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LL{{$}}
-  // CHECK-FIXES: static constexpr auto v7 = 1LL;
-  static_assert(is_same<decltype(v7), const long long>::value, "");
-  static_assert(v7 == 1, "");
-
-  static constexpr auto v8 = 1LL; // OK.
-  static_assert(is_same<decltype(v8), const long long>::value, "");
-  static_assert(v8 == 1, "");
-
-  // Unsigned Long
-
-  static constexpr auto v9 = 1ul;
-  static_assert(is_same<decltype(v9), const unsigned long>::value, "");
-  static_assert(v9 == 1, "");
-
-  static constexpr auto v10 = 1uL;
-  static_assert(is_same<decltype(v10), const unsigned long>::value, "");
-  static_assert(v10 == 1, "");
-
-  static constexpr auto v11 = 1Ul;
-  static_assert(is_same<decltype(v11), const unsigned long>::value, "");
-  static_assert(v11 == 1, "");
-
-  static constexpr auto v12 = 1UL; // OK.
-  static_assert(is_same<decltype(v12), const unsigned long>::value, "");
-  static_assert(v12 == 1, "");
-
-  // Long Unsigned
-
-  static constexpr auto v13 = 1lu;
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lu', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v13 = 1lu;
-  // CHECK-MESSAGES-NEXT: ^~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}}
-  // CHECK-FIXES: static constexpr auto v13 = 1LU;
-  static_assert(is_same<decltype(v13), const unsigned long>::value, "");
-  static_assert(v13 == 1, "");
-
-  static constexpr auto v14 = 1Lu;
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Lu', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 1Lu;
-  // CHECK-MESSAGES-NEXT: ^~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}}
-  // CHECK-FIXES: static constexpr auto v14 = 1LU;
-  static_assert(is_same<decltype(v14), const unsigned long>::value, "");
-  static_assert(v14 == 1, "");
-
-  static constexpr auto v15 = 1lU;
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lU', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v15 = 1lU;
-  // CHECK-MESSAGES-NEXT: ^~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}}
-  // CHECK-FIXES: static constexpr auto v15 = 1LU;
-  static_assert(is_same<decltype(v15), const unsigned long>::value, "");
-  static_assert(v15 == 1, "");
-
-  static constexpr auto v16 = 1LU; // OK.
-  static_assert(is_same<decltype(v16), const unsigned long>::value, "");
-  static_assert(v16 == 1, "");
-
-  // Unsigned Long Long
-
-  static constexpr auto v17 = 1ull;
-  static_assert(is_same<decltype(v17), const unsigned long long>::value, "");
-  static_assert(v17 == 1, "");
-
-  static constexpr auto v18 = 1uLL;
-  static_assert(is_same<decltype(v18), const unsigned long long>::value, "");
-  static_assert(v18 == 1, "");
-
-  static constexpr auto v19 = 1Ull;
-  static_assert(is_same<decltype(v19), const unsigned long long>::value, "");
-  static_assert(v19 == 1, "");
-
-  static constexpr auto v20 = 1ULL; // OK.
-  static_assert(is_same<decltype(v20), const unsigned long long>::value, "");
-  static_assert(v20 == 1, "");
-
-  // Long Long Unsigned
-
-  static constexpr auto v21 = 1llu;
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llu', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v21 = 1llu;
-  // CHECK-MESSAGES-NEXT: ^~~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}}
-  // CHECK-FIXES: static constexpr auto v21 = 1LLU;
-  static_assert(is_same<decltype(v21), const unsigned long long>::value, "");
-  static_assert(v21 == 1, "");
-
-  static constexpr auto v22 = 1LLu;
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'LLu', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v22 = 1LLu;
-  // CHECK-MESSAGES-NEXT: ^~~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}}
-  // CHECK-FIXES: static constexpr auto v22 = 1LLU;
-  static_assert(is_same<decltype(v22), const unsigned long long>::value, "");
-  static_assert(v22 == 1, "");
-
-  static constexpr auto v23 = 1llU;
-  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llU', which is not uppercase
-  // CHECK-MESSAGES-NEXT: static constexpr auto v23 = 1llU;
-  // CHECK-MESSAGES-NEXT: ^~~~
-  // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}}
-  // CHECK-FIXES: static constexpr auto v23 = 1LLU;
-  static_assert(is_same<decltype(v23), const unsigned long long>::value, "");
-  static_assert(v23 == 1, "");
-
-  static constexpr auto v24 = 1LLU; // OK.
-  static_assert(is_same<decltype(v24), const unsigned long long>::value, "");
-  static_assert(v24 == 1, "");
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/cert-variadic-function-def.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/cert-variadic-function-def.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cert-variadic-function-def.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/cert-variadic-function-def.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %check_clang_tidy %s cert-dcl50-cpp %t
-
-// Variadic function definitions are diagnosed.
-void f1(int, ...) {}
-// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: do not define a C-style variadic function; consider using a function parameter pack or currying instead [cert-dcl50-cpp]
-
-// Variadic function *declarations* are not diagnosed.
-void f2(int, ...); // ok
-
-// Function parameter packs are good, however.
-template <typename Arg, typename... Ts>
-void f3(Arg F, Ts... Rest) {}
-
-struct S {
-  void f(int, ...); // ok
-  void f1(int, ...) {}
-  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: do not define a C-style variadic function; consider using a function parameter pack or currying instead
-};
-
-// Function definitions that are extern "C" are good.
-extern "C" void f4(int, ...) {} // ok
-extern "C" {
-  void f5(int, ...) {} // ok
-}

Removed: clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.cpp?rev=374539&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.cpp (removed)
@@ -1,32 +0,0 @@
-// RUN: %check_clang_tidy -check-suffix=USING-A %s misc-unused-using-decls %t -- -- -DUSING_A
-// RUN: %check_clang_tidy -check-suffix=USING-B %s misc-unused-using-decls %t -- -- -DUSING_B
-// RUN: %check_clang_tidy -check-suffix=USING-C,USING-D %s misc-unused-using-decls %t -- -- -DUSING_C_D
-// RUN: %check_clang_tidy -check-suffixes=USING-C,USING-D %s misc-unused-using-decls %t -- -- -DUSING_C_D
-// RUN: %check_clang_tidy %s misc-unused-using-decls %t
-
-namespace a {class A {}; class B {}; class C {}; class D {}; class E {};}
-namespace b {
-#if defined(USING_A)
-using a::A;
-#elif  defined(USING_B)
-using a::B;
-#elif  defined(USING_C_D)
-using a::C;
-using a::D;
-#else
-using a::E;
-#endif
-}
-namespace c {}
-// CHECK-MESSAGES-USING-A: warning: using decl 'A' {{.*}}
-// CHECK-MESSAGES-USING-B: warning: using decl 'B' {{.*}}
-// CHECK-MESSAGES-USING-C: warning: using decl 'C' {{.*}}
-// CHECK-MESSAGES-USING-D: warning: using decl 'D' {{.*}}
-// CHECK-MESSAGES: warning: using decl 'E' {{.*}}
-// CHECK-FIXES-USING-A-NOT: using a::A;$
-// CHECK-FIXES-USING-B-NOT: using a::B;$
-// CHECK-FIXES-USING-C-NOT: using a::C;$
-// CHECK-FIXES-USING-C-NOT: using a::D;$
-// CHECK-FIXES-USING-D-NOT: using a::C;$
-// CHECK-FIXES-USING-D-NOT: using a::D;$
-// CHECK-FIXES-NOT: using a::E;$

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/a.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/a.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/b.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/b.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang-c/c.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang-c/c.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang/b.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/clang/b.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-a.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-a.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-b.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-b.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-c.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-c.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-c.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/cross-file-c.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// The line number of the following include should match the location of the
+// corresponding comment in llvm-include-order.cpp
+#include "cross-file-b.h"

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/gtest/foo.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/gtest/foo.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/i.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/i.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/j.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/j.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm-c/d.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm-c/d.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm/a.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/llvm/a.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/s.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/s.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/system-header-simulation.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/system-header-simulation.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/system-header-simulation.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/Headers/system-header-simulation.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,24 @@
+#pragma clang system_header
+
+namespace std {
+
+template<class T, T v>
+struct integral_constant {
+    static constexpr T value = v;
+    typedef T value_type;
+    typedef integral_constant type;
+    constexpr operator value_type() const noexcept { return value; }
+};
+
+template <bool B>
+using bool_constant = integral_constant<bool, B>;
+using true_type = bool_constant<true>;
+using false_type = bool_constant<false>;
+
+template<class T>
+struct is_error_code_enum : false_type {};
+
+template<class T>
+void swap(T &a, T &b);
+}
+

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/external-file.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/external-file.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/external-file.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/external-file.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,6 @@
+namespace absl {
+namespace base_internal {
+void InternalFunction() {}
+} // namespace base_internal 
+} //namespace absl
+void DirectAccess2() { absl::base_internal::InternalFunction(); }

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/flags/internal-file.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/flags/internal-file.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/flags/internal-file.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/flags/internal-file.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1 @@
+#define USE_INTERNAL(x) absl::strings_internal::Internal##x()

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/strings/internal-file.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/strings/internal-file.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/strings/internal-file.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/strings/internal-file.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,33 @@
+namespace std {
+struct string {
+  string(const char *);
+  ~string();
+};
+} // namespace std
+
+namespace absl {
+std::string StringsFunction(std::string s1) { return s1; }
+class SomeContainer {};
+namespace strings_internal {
+void InternalFunction() {}
+template <class P> P InternalTemplateFunction(P a) {}
+} // namespace strings_internal
+
+namespace container_internal {
+struct InternalStruct {};
+} // namespace container_internal
+} // namespace absl
+
+// should not trigger warnings because inside Abseil files
+void DirectAcessInternal() {
+  absl::strings_internal::InternalFunction();
+  absl::strings_internal::InternalTemplateFunction<std::string>("a");
+}
+
+class FriendUsageInternal {
+  friend struct absl::container_internal::InternalStruct;
+};
+
+namespace absl {
+void OpeningNamespaceInternally() { strings_internal::InternalFunction(); }
+} // namespace absl

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/time/time.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/time/time.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/time/time.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/absl/time/time.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,92 @@
+// Mimic the implementation of absl::Duration
+namespace absl {
+
+using int64_t = long long int;
+
+class Duration {
+public:
+  Duration &operator*=(int64_t r);
+  Duration &operator*=(float r);
+  Duration &operator*=(double r);
+  template <typename T> Duration &operator*=(T r);
+
+  Duration &operator/=(int64_t r);
+  Duration &operator/=(float r);
+  Duration &operator/=(double r);
+  template <typename T> Duration &operator/=(T r);
+
+  Duration &operator+(Duration d);
+};
+
+template <typename T> Duration operator*(Duration lhs, T rhs);
+template <typename T> Duration operator*(T lhs, Duration rhs);
+template <typename T> Duration operator/(Duration lhs, T rhs);
+int64_t operator/(Duration lhs, Duration rhs);
+
+class Time{};
+
+constexpr Duration Nanoseconds(long long);
+constexpr Duration Microseconds(long long);
+constexpr Duration Milliseconds(long long);
+constexpr Duration Seconds(long long);
+constexpr Duration Minutes(long long);
+constexpr Duration Hours(long long);
+
+template <typename T> struct EnableIfFloatImpl {};
+template <> struct EnableIfFloatImpl<float> { typedef int Type; };
+template <> struct EnableIfFloatImpl<double> { typedef int Type; };
+template <> struct EnableIfFloatImpl<long double> { typedef int Type; };
+template <typename T> using EnableIfFloat = typename EnableIfFloatImpl<T>::Type;
+
+template <typename T, EnableIfFloat<T> = 0> Duration Nanoseconds(T n);
+template <typename T, EnableIfFloat<T> = 0> Duration Microseconds(T n);
+template <typename T, EnableIfFloat<T> = 0> Duration Milliseconds(T n);
+template <typename T, EnableIfFloat<T> = 0> Duration Seconds(T n);
+template <typename T, EnableIfFloat<T> = 0> Duration Minutes(T n);
+template <typename T, EnableIfFloat<T> = 0> Duration Hours(T n);
+
+double ToDoubleHours(Duration d);
+double ToDoubleMinutes(Duration d);
+double ToDoubleSeconds(Duration d);
+double ToDoubleMilliseconds(Duration d);
+double ToDoubleMicroseconds(Duration d);
+double ToDoubleNanoseconds(Duration d);
+int64_t ToInt64Hours(Duration d);
+int64_t ToInt64Minutes(Duration d);
+int64_t ToInt64Seconds(Duration d);
+int64_t ToInt64Milliseconds(Duration d);
+int64_t ToInt64Microseconds(Duration d);
+int64_t ToInt64Nanoseconds(Duration d);
+
+int64_t ToUnixHours(Time t);
+int64_t ToUnixMinutes(Time t);
+int64_t ToUnixSeconds(Time t);
+int64_t ToUnixMillis(Time t);
+int64_t ToUnixMicros(Time t);
+int64_t ToUnixNanos(Time t);
+Time FromUnixHours(int64_t);
+Time FromUnixMinutes(int64_t);
+Time FromUnixSeconds(int64_t);
+Time FromUnixMillis(int64_t);
+Time FromUnixMicros(int64_t);
+Time FromUnixNanos(int64_t);
+
+Time Now();
+
+// Relational Operators
+constexpr bool operator<(Duration lhs, Duration rhs);
+constexpr bool operator>(Duration lhs, Duration rhs);
+constexpr bool operator>=(Duration lhs, Duration rhs);
+constexpr bool operator<=(Duration lhs, Duration rhs);
+constexpr bool operator==(Duration lhs, Duration rhs);
+constexpr bool operator!=(Duration lhs, Duration rhs);
+
+// Additive Operators
+inline Time operator+(Time lhs, Duration rhs);
+inline Time operator+(Duration lhs, Time rhs);
+inline Time operator-(Time lhs, Duration rhs);
+inline Duration operator-(Time lhs, Time rhs);
+
+double FDivDuration(Duration num, Duration den);
+
+}  // namespace absl

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/a.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/a.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdarg.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdarg.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdlib.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdlib.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/j.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/j.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/r.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/r.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/r.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/r.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1 @@
+void f() {}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/s.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/s.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/t.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/t.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/transitive.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/transitive.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/transitive.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/transitive.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,3 @@
+#include <r.h>
+#include <t.h>
+#include <s.h>

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/transitive2.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/transitive2.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/transitive2.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/transitive2.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,2 @@
+#include <s.h>
+#include <t.h>

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/google-namespaces.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/google-namespaces.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/google-namespaces.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/google-namespaces.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,7 @@
+namespace {
+int x;
+}
+
+namespace spaaaace {
+class core;
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest-typed-test.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest-typed-test.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest-typed-test.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest-typed-test.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,16 @@
+#ifndef THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_TYPED_TEST_H_
+#define THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_TYPED_TEST_H_
+
+#define TYPED_TEST_SUITE(CaseName, Types, ...)
+#define TYPED_TEST_CASE TYPED_TEST_SUITE
+
+#define TYPED_TEST_SUITE_P(SuiteName)
+#define TYPED_TEST_CASE_P TYPED_TEST_SUITE_P
+
+#define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...)
+#define REGISTER_TYPED_TEST_CASE_P REGISTER_TYPED_TEST_SUITE_P
+
+#define INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...)
+#define INSTANTIATE_TYPED_TEST_CASE_P INSTANTIATE_TYPED_TEST_SUITE_P
+
+#endif  // THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_TYPED_TEST_H_

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/gtest.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,66 @@
+#ifndef THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_
+#define THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_
+
+#include "gtest/gtest-typed-test.h"
+
+namespace testing {
+
+class Test {
+public:
+  static void SetUpTestCase();
+  static void TearDownTestCase();
+
+  static void SetUpTestSuite();
+  static void TearDownTestSuite();
+};
+
+class TestSuite {};
+using TestCase = TestSuite;
+
+class TestInfo {
+public:
+  const char *test_case_name() const;
+
+  const char *test_suite_name() const;
+};
+
+class TestEventListener {
+public:
+  virtual void OnTestCaseStart(const TestCase &);
+  virtual void OnTestCaseEnd(const TestCase &);
+
+  virtual void OnTestSuiteStart(const TestCase &);
+  virtual void OnTestSuiteEnd(const TestCase &);
+};
+
+class EmptyTestEventListener : public TestEventListener {
+public:
+  void OnTestCaseStart(const TestCase &) override;
+  void OnTestCaseEnd(const TestCase &) override;
+
+  void OnTestSuiteStart(const TestCase &) override;
+  void OnTestSuiteEnd(const TestCase &) override;
+};
+
+class UnitTest {
+public:
+  static UnitTest *GetInstance();
+
+  TestCase *current_test_case() const;
+  int successful_test_case_count() const;
+  int failed_test_case_count() const;
+  int total_test_case_count() const;
+  int test_case_to_run_count() const;
+  const TestCase *GetTestCase(int) const;
+
+  TestSuite *current_test_suite() const;
+  int successful_test_suite_count() const;
+  int failed_test_suite_count() const;
+  int total_test_suite_count() const;
+  int test_suite_to_run_count() const;
+  const TestSuite *GetTestSuite(int) const;
+};
+
+} // namespace testing
+
+#endif // THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest-typed-test.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest-typed-test.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest-typed-test.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest-typed-test.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,12 @@
+#ifndef THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_TYPED_TEST_H_
+#define THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_TYPED_TEST_H_
+
+#define TYPED_TEST_CASE(CaseName, Types, ...)
+
+#define TYPED_TEST_CASE_P(SuiteName)
+
+#define REGISTER_TYPED_TEST_CASE_P(SuiteName, ...)
+
+#define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, SuiteName, Types, ...)
+
+#endif  // THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_TYPED_TEST_H_

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/gtest/nosuite/gtest/gtest.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,47 @@
+#ifndef THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_
+#define THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_
+
+#include "gtest/gtest-typed-test.h"
+
+namespace testing {
+
+class Test {
+public:
+  static void SetUpTestCase();
+  static void TearDownTestCase();
+};
+
+class TestCase {};
+
+class TestInfo {
+public:
+  const char *test_case_name() const;
+};
+
+class TestEventListener {
+public:
+  virtual void OnTestCaseStart(const TestCase &);
+  virtual void OnTestCaseEnd(const TestCase &);
+};
+
+class EmptyTestEventListener : public TestEventListener {
+public:
+  void OnTestCaseStart(const TestCase &) override;
+  void OnTestCaseEnd(const TestCase &) override;
+};
+
+class UnitTest {
+public:
+  static UnitTest *GetInstance();
+
+  TestCase *current_test_case() const;
+  int successful_test_case_count() const;
+  int failed_test_case_count() const;
+  int total_test_case_count() const;
+  int test_case_to_run_count() const;
+  const TestCase *GetTestCase(int) const;
+};
+
+} // namespace testing
+
+#endif // THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/assert.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/assert.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/complex.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/complex.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/ctype.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/ctype.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/errno.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/errno.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/fenv.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/fenv.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/float.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/float.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/inttypes.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/inttypes.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/iso646.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/iso646.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/limits.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/limits.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/locale.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/locale.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/math.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/math.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/setjmp.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/setjmp.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/signal.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/signal.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdalign.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdalign.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdarg.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdarg.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdbool.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdbool.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stddef.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stddef.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdint.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdint.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdio.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdio.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdlib.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/stdlib.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/string.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/string.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/tgmath.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/tgmath.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/time.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/time.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/uchar.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/uchar.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/wchar.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/wchar.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/wctype.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/wctype.h?rev=374540&view=auto
==============================================================================
    (empty)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-loop-convert/structures.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-loop-convert/structures.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-loop-convert/structures.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-loop-convert/structures.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,206 @@
+#ifndef STRUCTURES_H
+#define STRUCTURES_H
+
+extern "C" {
+extern int printf(const char *restrict, ...);
+}
+
+struct Val {int X; void g(); };
+
+struct MutableVal {
+  void constFun(int) const;
+  void nonConstFun(int, int);
+  void constFun(MutableVal &) const;
+  void constParamFun(const MutableVal &) const;
+  void nonConstParamFun(const MutableVal &);
+  int X;
+};
+
+struct NonTriviallyCopyable {
+  NonTriviallyCopyable() = default;
+  // Define this constructor to make this class non-trivially copyable.
+  NonTriviallyCopyable(const NonTriviallyCopyable& Ntc);
+  int X;
+};
+
+struct TriviallyCopyableButBig {
+  int X;
+  char Array[16];
+};
+
+struct S {
+  typedef MutableVal *iterator;
+  typedef const MutableVal *const_iterator;
+  const_iterator begin() const;
+  const_iterator end() const;
+  const_iterator cbegin() const;
+  const_iterator cend() const;
+  iterator begin();
+  iterator end();
+};
+
+struct T {
+  struct iterator {
+    int& operator*();
+    const int& operator*()const;
+    iterator& operator ++();
+    bool operator!=(const iterator &other);
+    void insert(int);
+    int X;
+  };
+  iterator begin();
+  iterator end();
+};
+
+struct U {
+  struct iterator {
+    Val& operator*();
+    const Val& operator*()const;
+    iterator& operator ++();
+    bool operator!=(const iterator &other);
+    Val *operator->();
+  };
+  iterator begin();
+  iterator end();
+  int X;
+};
+
+struct X {
+  S Ss;
+  T Tt;
+  U Uu;
+  S getS();
+};
+
+template<typename ElemType>
+class dependent {
+ public:
+  dependent<ElemType>();
+  struct iterator_base {
+    const ElemType& operator*()const;
+    iterator_base& operator ++();
+    bool operator!=(const iterator_base &other) const;
+    const ElemType *operator->() const;
+  };
+
+  struct iterator : iterator_base {
+    ElemType& operator*();
+    iterator& operator ++();
+    ElemType *operator->();
+  };
+
+  typedef iterator_base const_iterator;
+  const_iterator begin() const;
+  const_iterator end() const;
+  iterator begin();
+  iterator end();
+  unsigned size() const;
+  ElemType & operator[](unsigned);
+  const ElemType & operator[](unsigned) const;
+  ElemType & at(unsigned);
+  ElemType & at(unsigned, unsigned);
+  const ElemType & at(unsigned) const;
+
+  // Intentionally evil.
+  dependent<ElemType> operator*();
+
+  void foo();
+  void constFoo() const;
+};
+
+template<typename First, typename Second>
+class doublyDependent{
+ public:
+  struct Value {
+    First first;
+    Second second;
+  };
+
+  struct iterator_base {
+    const Value& operator*()const;
+    iterator_base& operator ++();
+    bool operator!=(const iterator_base &other) const;
+    const Value *operator->() const;
+  };
+
+  struct iterator : iterator_base {
+    Value& operator*();
+    Value& operator ++();
+    Value *operator->();
+  };
+
+  typedef iterator_base const_iterator;
+  const_iterator begin() const;
+  const_iterator end() const;
+  iterator begin();
+  iterator end();
+};
+
+template<typename Contained>
+class transparent {
+ public:
+  Contained *at();
+  Contained *operator->();
+  Contained operator*();
+};
+
+template<typename IteratorType>
+struct Nested {
+  typedef IteratorType* iterator;
+  typedef const IteratorType* const_iterator;
+  IteratorType *operator->();
+  IteratorType operator*();
+  iterator begin();
+  iterator end();
+  const_iterator begin() const;
+  const_iterator end() const;
+};
+
+// Like llvm::SmallPtrSet, the iterator has a dereference operator that returns
+// by value instead of by reference.
+template <typename T>
+struct PtrSet {
+  struct iterator {
+    bool operator!=(const iterator &other) const;
+    const T operator*();
+    iterator &operator++();
+  };
+  iterator begin() const;
+  iterator end() const;
+};
+
+template <typename T>
+struct TypedefDerefContainer {
+  struct iterator {
+    typedef T &deref_type;
+    bool operator!=(const iterator &other) const;
+    deref_type operator*();
+    iterator &operator++();
+  };
+  iterator begin() const;
+  iterator end() const;
+};
+
+template <typename T>
+struct RValueDerefContainer {
+  struct iterator {
+    typedef T &&deref_type;
+    bool operator!=(const iterator &other) const;
+    deref_type operator*();
+    iterator &operator++();
+  };
+  iterator begin() const;
+  iterator end() const;
+};
+
+namespace Macros {
+
+struct MacroStruct {
+  int Arr[10];
+};
+static MacroStruct *MacroSt;
+#define CONT MacroSt->
+
+} // namespace Macros
+
+#endif  // STRUCTURES_H

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header-with-fix.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header-with-fix.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header-with-fix.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header-with-fix.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,8 @@
+struct S {
+  S(S&&);
+  S(const S&);
+};
+struct Foo {
+  Foo(const S &s);
+  S s;
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-pass-by-value/header.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,10 @@
+class ThreadId {
+public:
+  ThreadId(const ThreadId &) {}
+  ThreadId(ThreadId &&) {}
+};
+
+struct A {
+  A(const ThreadId &tid) : threadid(tid) {}
+  ThreadId threadid;
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-replace-auto-ptr/memory.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-replace-auto-ptr/memory.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-replace-auto-ptr/memory.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-replace-auto-ptr/memory.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,45 @@
+#ifndef INPUTS_MEMORY_H
+#define INPUTS_MEMORY_H
+
+namespace std {
+
+inline namespace _1 {
+
+template <class Y> struct auto_ptr_ref {
+  Y *y_;
+};
+
+template <class X> class auto_ptr {
+public:
+  typedef X element_type;
+  explicit auto_ptr(X *p = 0) throw() {}
+  auto_ptr(auto_ptr &) throw() {}
+  template <class Y> auto_ptr(auto_ptr<Y> &) throw() {}
+  auto_ptr &operator=(auto_ptr &) throw() { return *this; }
+  template <class Y> auto_ptr &operator=(auto_ptr<Y> &) throw() {
+    return *this;
+  }
+  auto_ptr &operator=(auto_ptr_ref<X> r) throw() { return *this; }
+  ~auto_ptr() throw() {}
+  auto_ptr(auto_ptr_ref<X> r) throw() : x_(r.y_) {}
+  template <class Y> operator auto_ptr_ref<Y>() throw() {
+    auto_ptr_ref<Y> r;
+    r.y_ = x_;
+    return r;
+  }
+  template <class Y> operator auto_ptr<Y>() throw() { return auto_ptr<Y>(x_); }
+
+private:
+  X *x_;
+};
+
+template <> class auto_ptr<void> {
+public:
+  typedef void element_type;
+};
+
+} // namespace _1
+
+} // end namespace std
+
+#endif // INPUTS_MEMORY_H

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/initializer_list.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/initializer_list.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/initializer_list.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/initializer_list.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,32 @@
+namespace std {
+typedef decltype(sizeof(int)) size_t;
+
+template <class _E> class initializer_list {
+  const _E *__begin_;
+  size_t __size_;
+
+  initializer_list(const _E *__b, size_t __s) : __begin_(__b), __size_(__s) {}
+
+public:
+  typedef _E value_type;
+  typedef const _E &reference;
+  typedef const _E &const_reference;
+  typedef size_t size_type;
+
+  typedef const _E *iterator;
+  typedef const _E *const_iterator;
+
+  initializer_list() : __begin_(nullptr), __size_(0) {}
+
+  size_t size() const { return __size_; }
+  const _E *begin() const { return __begin_; }
+  const _E *end() const { return __begin_ + __size_; }
+};
+
+template <class _E>
+class vector {
+ public:
+  vector(initializer_list<_E> init);
+  ~vector();
+};
+} // namespace std

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/shared_ptr.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/shared_ptr.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/shared_ptr.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/shared_ptr.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,24 @@
+namespace std {
+
+template <typename type>
+class shared_ptr {
+public:
+  shared_ptr();
+  shared_ptr(type *ptr);
+  shared_ptr(const shared_ptr<type> &t) {}
+  shared_ptr(shared_ptr<type> &&t) {}
+  ~shared_ptr();
+  type &operator*() { return *ptr; }
+  type *operator->() { return ptr; }
+  type *release();
+  void reset();
+  void reset(type *pt);
+  shared_ptr &operator=(shared_ptr &&);
+  template <typename T>
+  shared_ptr &operator=(shared_ptr<T> &&);
+
+private:
+  type *ptr;
+};
+
+}  // namespace std

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/unique_ptr.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/unique_ptr.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/unique_ptr.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-smart-ptr/unique_ptr.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,28 @@
+namespace std {
+
+template <typename T>
+class default_delete {};
+
+template <typename type, typename Deleter = std::default_delete<type>>
+class unique_ptr {
+public:
+  unique_ptr() {}
+  unique_ptr(type *ptr) {}
+  unique_ptr(const unique_ptr<type> &t) = delete;
+  unique_ptr(unique_ptr<type> &&t) {}
+  ~unique_ptr() {}
+  type &operator*() { return *ptr; }
+  type *operator->() { return ptr; }
+  type *release() { return ptr; }
+  void reset() {}
+  void reset(type *pt) {}
+  void reset(type pt) {}
+  unique_ptr &operator=(unique_ptr &&) { return *this; }
+  template <typename T>
+  unique_ptr &operator=(unique_ptr<T> &&) { return *this; }
+
+private:
+  type *ptr;
+};
+
+}  // namespace std

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-use-auto/containers.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-use-auto/containers.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-use-auto/containers.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/modernize-use-auto/containers.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,253 @@
+#ifndef CONTAINERS_H
+#define CONTAINERS_H
+
+namespace std {
+
+template <typename T>
+class iterator {
+public:
+  iterator() {}
+  iterator(const iterator<T> &iter) : ptr(iter.ptr) {}
+
+  typedef T value_type;
+  typedef T *pointer;
+  typedef T &reference;
+
+  reference operator*() const { return *ptr; }
+  pointer operator->() const { return ptr; }
+  iterator &operator++() {
+    ++ptr;
+    return *this;
+  }
+  iterator &operator--() {
+    --ptr;
+    return *this;
+  }
+  iterator operator++(int) {
+    iterator res(*this);
+    ++ptr;
+    return res;
+  }
+  iterator operator--(int) {
+    iterator res(*this);
+    --ptr;
+    return res;
+  }
+  bool operator!=(const iterator<T> &iter) const {
+    return ptr != iter.operator->();
+  }
+
+private:
+  T *ptr;
+};
+
+template <class Iterator>
+class const_iterator {
+public:
+  const_iterator() {}
+  const_iterator(const Iterator &iter) : iter(iter) {}
+  const_iterator(const const_iterator<Iterator> &citer) : iter(citer.iter) {}
+
+  typedef const typename Iterator::value_type value_type;
+  typedef const typename Iterator::pointer pointer;
+  typedef const typename Iterator::reference reference;
+
+  reference operator*() const { return *iter; }
+  pointer operator->() const { return iter.operator->(); }
+
+  const_iterator &operator++() { return ++iter; }
+  const_iterator &operator--() { return --iter; }
+  const_iterator operator++(int) { return iter--; }
+  const_iterator operator--(int) { return iter--; }
+
+  bool operator!=(const Iterator &it) const {
+    return iter->operator->() != it.operator->();
+  }
+  bool operator!=(const const_iterator<Iterator> &it) const {
+    return iter.operator->() != it.operator->();
+  }
+
+private:
+  Iterator iter;
+};
+
+template <class Iterator>
+class forward_iterable {
+public:
+  forward_iterable() {}
+  typedef Iterator iterator;
+  typedef const_iterator<Iterator> const_iterator;
+
+  iterator begin() { return _begin; }
+  iterator end() { return _end; }
+
+  const_iterator begin() const { return _begin; }
+  const_iterator end() const { return _end; }
+
+  const_iterator cbegin() const { return _begin; }
+  const_iterator cend() const { return _end; }
+
+private:
+  iterator _begin, _end;
+};
+
+template <class Iterator>
+class reverse_iterator {
+public:
+  reverse_iterator() {}
+  reverse_iterator(const Iterator &iter) : iter(iter) {}
+  reverse_iterator(const reverse_iterator<Iterator> &rit) : iter(rit.iter) {}
+
+  typedef typename Iterator::value_type value_type;
+  typedef typename Iterator::pointer pointer;
+  typedef typename Iterator::reference reference;
+
+  reference operator*() { return *iter; }
+  pointer operator->() { return iter.operator->(); }
+
+  reverse_iterator &operator++() { return --iter; }
+  reverse_iterator &operator--() { return ++iter; }
+  reverse_iterator operator++(int) { return iter--; }
+  reverse_iterator operator--(int) { return iter++; }
+
+private:
+  Iterator iter;
+};
+
+template <class Iterator>
+class backward_iterable {
+public:
+  backward_iterable() {}
+
+  typedef reverse_iterator<Iterator> reverse_iterator;
+  typedef const_iterator<reverse_iterator> const_reverse_iterator;
+
+  reverse_iterator rbegin() { return _rbegin; }
+  reverse_iterator rend() { return _rend; }
+
+  const_reverse_iterator rbegin() const { return _rbegin; }
+  const_reverse_iterator rend() const { return _rend; }
+
+  const_reverse_iterator crbegin() const { return _rbegin; }
+  const_reverse_iterator crend() const { return _rend; }
+
+private:
+  reverse_iterator _rbegin, _rend;
+};
+
+template <class Iterator>
+class bidirectional_iterable : public forward_iterable<Iterator>,
+                               public backward_iterable<Iterator> {};
+
+template <typename A, typename B>
+struct pair {
+  pair(A f, B s) : first(f), second(s) {}
+  A first;
+  B second;
+};
+
+class string {
+public:
+  string() {}
+  string(const char *) {}
+};
+
+template <typename T, int n>
+class array : public backward_iterable<iterator<T>> {
+public:
+  array() {}
+
+  typedef T *iterator;
+  typedef const T *const_iterator;
+
+  iterator begin() { return &v[0]; }
+  iterator end() { return &v[n - 1]; }
+
+  const_iterator begin() const { return &v[0]; }
+  const_iterator end() const { return &v[n - 1]; }
+
+  const_iterator cbegin() const { return &v[0]; }
+  const_iterator cend() const { return &v[n - 1]; }
+
+private:
+  T v[n];
+};
+
+template <typename T>
+class deque : public bidirectional_iterable<iterator<T>> {
+public:
+  deque() {}
+};
+
+template <typename T>
+class list : public bidirectional_iterable<iterator<T>> {
+public:
+  list() {}
+};
+
+template <typename T>
+class forward_list : public forward_iterable<iterator<T>> {
+public:
+  forward_list() {}
+};
+
+template <typename T>
+class vector : public bidirectional_iterable<iterator<T>> {
+public:
+  vector() {}
+};
+
+template <typename T>
+class set : public bidirectional_iterable<iterator<T>> {
+public:
+  set() {}
+};
+
+template <typename T>
+class multiset : public bidirectional_iterable<iterator<T>> {
+public:
+  multiset() {}
+};
+
+template <typename key, typename value>
+class map : public bidirectional_iterable<iterator<pair<key, value>>> {
+public:
+  map() {}
+
+  iterator<pair<key, value>> find(const key &) {}
+  const_iterator<iterator<pair<key, value>>> find(const key &) const {}
+};
+
+template <typename key, typename value>
+class multimap : public bidirectional_iterable<iterator<pair<key, value>>> {
+public:
+  multimap() {}
+};
+
+template <typename T>
+class unordered_set : public forward_iterable<iterator<T>> {
+public:
+  unordered_set() {}
+};
+
+template <typename T>
+class unordered_multiset : public forward_iterable<iterator<T>> {
+public:
+  unordered_multiset() {}
+};
+
+template <typename key, typename value>
+class unordered_map : public forward_iterable<iterator<pair<key, value>>> {
+public:
+  unordered_map() {}
+};
+
+template <typename key, typename value>
+class unordered_multimap : public forward_iterable<iterator<pair<key, value>>> {
+public:
+  unordered_multimap() {}
+};
+
+} // namespace std
+
+#endif // CONTAINERS_H

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/mpi-type-mismatch/mpimock.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/mpi-type-mismatch/mpimock.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/mpi-type-mismatch/mpimock.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/mpi-type-mismatch/mpimock.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,64 @@
+// This Message Passing Interface mock header is used, to mock typedefs,
+// constants and functions, required for integration tests being part of
+// clang-tidy MPI checks.
+
+#ifndef MPIMOCK_H
+#define MPIMOCK_H
+
+#define NULL 0
+
+// These typedefs are used to mock MPI types, fixed width integer types and the
+// templated C++ complex number type.
+typedef int MPI_Datatype;
+typedef int MPI_Comm;
+typedef int MPI_Request;
+typedef int MPI_Status;
+typedef int MPI_Op;
+typedef int int8_t;
+typedef int uint8_t;
+typedef int uint16_t;
+typedef int int64_t;
+namespace std { template<class T> struct complex { T real; T imag; }; }
+
+// These defines are used to mock MPI constants.
+#define MPI_DATATYPE_NULL 0
+#define MPI_CHAR 0
+#define MPI_BYTE 0
+#define MPI_SHORT 0
+#define MPI_INT 0
+#define MPI_LONG 0
+#define MPI_LONG_DOUBLE 0
+#define MPI_UNSIGNED 0
+#define MPI_INT8_T 0
+#define MPI_UINT8_T 0
+#define MPI_UINT16_T 0
+#define MPI_C_FLOAT_COMPLEX 0
+#define MPI_C_LONG_DOUBLE_COMPLEX 0
+#define MPI_FLOAT 0
+#define MPI_DOUBLE 0
+#define MPI_CXX_BOOL 0
+#define MPI_CXX_FLOAT_COMPLEX 0
+#define MPI_CXX_DOUBLE_COMPLEX 0
+#define MPI_CXX_LONG_DOUBLE_COMPLEX 0
+#define MPI_IN_PLACE 0
+#define MPI_COMM_WORLD 0
+#define MPI_STATUS_IGNORE 0
+#define MPI_STATUSES_IGNORE 0
+#define MPI_SUM 0
+
+// These declarations are used to mock MPI functions.
+int MPI_Comm_size(MPI_Comm, int *);
+int MPI_Comm_rank(MPI_Comm, int *);
+int MPI_Send(const void *, int, MPI_Datatype, int, int, MPI_Comm);
+int MPI_Recv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
+int MPI_Isend(const void *, int, MPI_Datatype, int, int, MPI_Comm,
+    MPI_Request *);
+int MPI_Irecv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
+int MPI_Wait(MPI_Request *, MPI_Status *);
+int MPI_Waitall(int, MPI_Request[], MPI_Status[]);
+int MPI_Reduce(const void *, void *, int, MPI_Datatype, MPI_Op, int, MPI_Comm);
+int MPI_Ireduce(const void *, void *, int, MPI_Datatype, MPI_Op, int, MPI_Comm,
+    MPI_Request *);
+int MPI_Bcast(void *, int count, MPI_Datatype, int, MPI_Comm);
+
+#endif  // end of include guard: MPIMOCK_H

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header-fixed.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header-fixed.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header-fixed.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header-fixed.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,15 @@
+// struct ABC is expensive to copy and should be
+// passed as a const referece.
+struct ABC {
+  ABC(const ABC&);
+  int get(int) const;
+};
+
+
+int f1(int n,              const ABC& v1,   const ABC& v2); // line 9
+
+int f1(int n, ABC v1); // line 11
+
+
+
+int f2(        int n,       const ABC& v2); // line 15

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/performance-unnecessary-value-param/header.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,15 @@
+// struct ABC is expensive to copy and should be
+// passed as a const referece.
+struct ABC {
+  ABC(const ABC&);
+  int get(int) const;
+};
+
+
+int f1(int n,              ABC v1,   ABC v2); // line 9
+
+int f1(int n, ABC v1); // line 11
+
+
+
+int f2(        int n,       ABC v2); // line 15

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/system-header.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/system-header.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/system-header.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/system-header.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,17 @@
+#ifndef SYSTEM_HEADER_H
+#define SYSTEM_HEADER_H
+
+#define SYSTEM_MACRO(m) int m = 0
+
+namespace SYSTEM_NS {
+class structure {
+  int member;
+};
+
+float global;
+
+void function() {
+}
+}
+
+#endif // SYSTEM_HEADER_H

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/user-header.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/user-header.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/user-header.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/readability-identifier-naming/user-header.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,17 @@
+#ifndef USER_HEADER_H
+#define USER_HEADER_H
+
+#define USER_MACRO(m) int m = 0
+
+namespace USER_NS {
+class object {
+  int member;
+};
+
+float global;
+
+void function() {
+}
+}
+
+#endif // USER_HEADER_H

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/unused-using-decls.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/unused-using-decls.h?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/unused-using-decls.h (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/Inputs/unused-using-decls.h Fri Oct 11 05:05:42 2019
@@ -0,0 +1,11 @@
+class MyClass {
+public:
+  template <template <typename> class S, typename T>
+  S<T> *func1(T *a) {
+    return new S<T>();
+  }
+  template <typename T, T (*S)()>
+  void func2(T a) {
+    S();
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-addition.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-addition.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-addition.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-addition.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,98 @@
+// RUN: %check_clang_tidy %s abseil-duration-addition %t -- -- -I%S/Inputs
+
+#include "absl/time/time.h"
+
+void f() {
+  absl::Time t;
+  int i;
+
+  i = absl::ToUnixHours(t) + 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixHours(t + absl::Hours(5))
+  i = absl::ToUnixMinutes(t) + 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMinutes(t + absl::Minutes(5))
+  i = absl::ToUnixSeconds(t) + 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(5))
+  i = absl::ToUnixMillis(t) + 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMillis(t + absl::Milliseconds(5))
+  i = absl::ToUnixMicros(t) + 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMicros(t + absl::Microseconds(5))
+  i = absl::ToUnixNanos(t) + 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixNanos(t + absl::Nanoseconds(5))
+
+  i = 3 + absl::ToUnixHours(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixHours(absl::Hours(3) + t)
+  i = 3 + absl::ToUnixMinutes(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMinutes(absl::Minutes(3) + t)
+  i = 3 + absl::ToUnixSeconds(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixSeconds(absl::Seconds(3) + t)
+  i = 3 + absl::ToUnixMillis(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMillis(absl::Milliseconds(3) + t)
+  i = 3 + absl::ToUnixMicros(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMicros(absl::Microseconds(3) + t)
+  i = 3 + absl::ToUnixNanos(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixNanos(absl::Nanoseconds(3) + t)
+
+  // Undoing inverse conversions
+  i = absl::ToUnixMicros(t) + absl::ToInt64Microseconds(absl::Seconds(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixMicros(t + absl::Seconds(1))
+
+  // Parens
+  i = 3 + (absl::ToUnixHours(t));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixHours(absl::Hours(3) + t)
+
+  // Float folding
+  i = absl::ToUnixSeconds(t) + 5.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(5))
+
+  // We can rewrite the argument of the duration conversion
+#define THIRTY absl::FromUnixSeconds(30)
+  i = absl::ToUnixSeconds(THIRTY) + 1;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixSeconds(THIRTY + absl::Seconds(1))
+#undef THIRTY
+
+  // Some other contexts
+  if (absl::ToUnixSeconds(t) + 1.0 > 10) {}
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(1))
+
+  // These should not match
+  i = 5 + 6;
+  i = absl::ToUnixSeconds(t) - 1.0;
+  i = absl::ToUnixSeconds(t) * 1.0;
+  i = absl::ToUnixSeconds(t) / 1.0;
+  i += absl::ToInt64Microseconds(absl::Seconds(1));
+
+#define PLUS_FIVE(z) absl::ToUnixSeconds(z) + 5
+  i = PLUS_FIVE(t);
+#undef PLUS_FIVE
+}
+
+// Within a templated function
+template<typename T>
+void foo(absl::Time t) {
+  int i = absl::ToUnixNanos(t) + T{};
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: perform addition in the duration domain [abseil-duration-addition]
+  // CHECK-FIXES: absl::ToUnixNanos(t + absl::Nanoseconds(T{}))
+}
+
+void g() {
+  absl::Time t;
+  foo<int>(t);
+  foo<double>(t);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-comparison.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-comparison.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-comparison.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-comparison.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,166 @@
+// RUN: %check_clang_tidy %s abseil-duration-comparison %t -- -- -I%S/Inputs
+
+#include "absl/time/time.h"
+
+void f() {
+  double x;
+  absl::Duration d1, d2;
+  bool b;
+  absl::Time t1, t2;
+
+  // Check against the RHS
+  b = x > absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) > d1;
+  b = x >= absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) >= d1;
+  b = x == absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) == d1;
+  b = x <= absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) <= d1;
+  b = x < absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) < d1;
+  b = x == absl::ToDoubleSeconds(t1 - t2);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) == t1 - t2;
+  b = absl::ToDoubleSeconds(d1) > absl::ToDoubleSeconds(d2);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 > d2;
+
+  // Check against the LHS
+  b = absl::ToDoubleSeconds(d1) < x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 < absl::Seconds(x);
+  b = absl::ToDoubleSeconds(d1) <= x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 <= absl::Seconds(x);
+  b = absl::ToDoubleSeconds(d1) == x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 == absl::Seconds(x);
+  b = absl::ToDoubleSeconds(d1) >= x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 >= absl::Seconds(x);
+  b = absl::ToDoubleSeconds(d1) > x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 > absl::Seconds(x);
+
+  // Comparison against zero
+  b = absl::ToDoubleSeconds(d1) < 0.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 < absl::ZeroDuration();
+  b = absl::ToDoubleSeconds(d1) < 0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: d1 < absl::ZeroDuration();
+
+  // Scales other than Seconds
+  b = x > absl::ToDoubleMicroseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Microseconds(x) > d1;
+  b = x >= absl::ToDoubleMilliseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Milliseconds(x) >= d1;
+  b = x == absl::ToDoubleNanoseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Nanoseconds(x) == d1;
+  b = x <= absl::ToDoubleMinutes(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Minutes(x) <= d1;
+  b = x < absl::ToDoubleHours(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Hours(x) < d1;
+
+  // Integer comparisons
+  b = x > absl::ToInt64Microseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Microseconds(x) > d1;
+  b = x >= absl::ToInt64Milliseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Milliseconds(x) >= d1;
+  b = x == absl::ToInt64Nanoseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Nanoseconds(x) == d1;
+  b = x == absl::ToInt64Seconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(x) == d1;
+  b = x <= absl::ToInt64Minutes(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Minutes(x) <= d1;
+  b = x < absl::ToInt64Hours(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Hours(x) < d1;
+
+  // Other abseil-duration checks folded into this one
+  b = static_cast<double>(5) > absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(5) > d1;
+  b = double(5) > absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(5) > d1;
+  b = float(5) > absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(5) > d1;
+  b = ((double)5) > absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(5) > d1;
+  b = 5.0 > absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Seconds(5) > d1;
+
+  // A long expression
+  bool some_condition;
+  int very_very_very_very_long_variable_name;
+  absl::Duration SomeDuration;
+  if (some_condition && very_very_very_very_long_variable_name
+     < absl::ToDoubleSeconds(SomeDuration)) {
+  // CHECK-MESSAGES: [[@LINE-2]]:25: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: if (some_condition && absl::Seconds(very_very_very_very_long_variable_name) < SomeDuration) {
+    return;
+  }
+
+  // A complex expression
+  int y;
+  b = (y + 5) * 10 > absl::ToDoubleMilliseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: absl::Milliseconds((y + 5) * 10) > d1;
+
+  // We should still transform the expression inside this macro invocation
+#define VALUE_IF(v, e) v ? (e) : 0
+  int a = VALUE_IF(1, 5 > absl::ToDoubleSeconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: VALUE_IF(1, absl::Seconds(5) > d1);
+#undef VALUE_IF
+
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e) v ? VALUE_IF_2(e) : VALUE_IF_2(0)
+  int a2 = VALUE_IF(1, 5 > absl::ToDoubleSeconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: perform comparison in the duration domain [abseil-duration-comparison]
+  // CHECK-FIXES: VALUE_IF(1, absl::Seconds(5) > d1);
+#undef VALUE_IF
+#undef VALUE_IF_2
+
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e, type) (v ? VALUE_IF_2(absl::To##type##Seconds(e)) : 0)
+  int a3 = VALUE_IF(1, d1, Double);
+#undef VALUE_IF
+#undef VALUE_IF_2
+
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e, type) (v ? (5 > VALUE_IF_2(absl::To##type##Seconds(e))) : 0)
+  int a4 = VALUE_IF(1, d1, Double);
+#undef VALUE_IF
+#undef VALUE_IF_2
+
+  // These should not match
+  b = 6 < 4;
+
+#define TODOUBLE(x) absl::ToDoubleSeconds(x)
+  b = 5.0 > TODOUBLE(d1);
+#undef TODOUBLE
+#define THIRTY 30.0
+  b = THIRTY > absl::ToDoubleSeconds(d1);
+#undef THIRTY
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-conversion-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-conversion-cast.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-conversion-cast.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-conversion-cast.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,95 @@
+// RUN: %check_clang_tidy %s abseil-duration-conversion-cast %t -- -- -I%S/Inputs
+
+#include "absl/time/time.h"
+
+void f() {
+  absl::Duration d1;
+  double x;
+  int i;
+
+  i = static_cast<int>(absl::ToDoubleHours(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Hours(d1);
+  x = static_cast<float>(absl::ToInt64Hours(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleHours(d1);
+  i = static_cast<int>(absl::ToDoubleMinutes(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Minutes(d1);
+  x = static_cast<float>(absl::ToInt64Minutes(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleMinutes(d1);
+  i = static_cast<int>(absl::ToDoubleSeconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Seconds(d1);
+  x = static_cast<float>(absl::ToInt64Seconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleSeconds(d1);
+  i = static_cast<int>(absl::ToDoubleMilliseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Milliseconds(d1);
+  x = static_cast<float>(absl::ToInt64Milliseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleMilliseconds(d1);
+  i = static_cast<int>(absl::ToDoubleMicroseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Microseconds(d1);
+  x = static_cast<float>(absl::ToInt64Microseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
+  i = static_cast<int>(absl::ToDoubleNanoseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Nanoseconds(d1);
+  x = static_cast<float>(absl::ToInt64Nanoseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleNanoseconds(d1);
+
+  // Functional-style casts
+  i = int(absl::ToDoubleHours(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Hours(d1);
+  x = float(absl::ToInt64Microseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
+
+  // C-style casts
+  i = (int) absl::ToDoubleHours(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Hours(d1);
+  x = (float) absl::ToInt64Microseconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
+
+  // Type aliasing
+  typedef int FancyInt;
+  typedef float FancyFloat;
+
+  FancyInt j = static_cast<FancyInt>(absl::ToDoubleHours(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToInt64Hours(d1);
+  FancyFloat k = static_cast<FancyFloat>(absl::ToInt64Microseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:18: warning: duration should be converted directly to a floating-point number rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: absl::ToDoubleMicroseconds(d1);
+
+  // Macro handling
+  // We want to transform things in macro arguments
+#define EXTERNAL(x) (x) + 5
+  i = EXTERNAL(static_cast<int>(absl::ToDoubleSeconds(d1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: duration should be converted directly to an integer rather than through a type cast [abseil-duration-conversion-cast]
+  // CHECK-FIXES: EXTERNAL(absl::ToInt64Seconds(d1));
+#undef EXTERNAL
+
+  // We don't want to transform this which get split across macro boundaries
+#define SPLIT(x) static_cast<int>((x)) + 5
+  i = SPLIT(absl::ToDoubleSeconds(d1));
+#undef SPLIT
+
+  // We also don't want to transform things inside of a macro definition
+#define INTERNAL(x) static_cast<int>(absl::ToDoubleSeconds((x))) + 5
+  i = INTERNAL(d1);
+#undef INTERNAL
+
+  // These shouldn't be converted
+  i = static_cast<int>(absl::ToInt64Seconds(d1));
+  i = static_cast<float>(absl::ToDoubleSeconds(d1));
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-division.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-division.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-division.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-division.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,75 @@
+// RUN: %check_clang_tidy %s abseil-duration-division %t
+
+namespace absl {
+
+class Duration {};
+
+int operator/(Duration lhs, Duration rhs);
+
+double FDivDuration(Duration num, Duration den);
+
+}  // namespace absl
+
+void TakesDouble(double);
+
+#define MACRO_EQ(x, y) (x == y)
+#define MACRO_DIVEQ(x,y,z) (x/y == z)
+#define CHECK(x) (x)
+
+void Positives() {
+  absl::Duration d;
+
+  const double num_double = d/d;
+  // CHECK-MESSAGES: [[@LINE-1]]:30: warning: operator/ on absl::Duration objects performs integer division; did you mean to use FDivDuration()? [abseil-duration-division]
+  // CHECK-FIXES: const double num_double = absl::FDivDuration(d, d);
+  const float num_float = d/d;
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: const float num_float = absl::FDivDuration(d, d);
+  const auto SomeVal = 1.0 + d/d;
+  // CHECK-MESSAGES: [[@LINE-1]]:31: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: const auto SomeVal = 1.0 + absl::FDivDuration(d, d);
+  if (MACRO_EQ(d/d, 0.0)) {}
+  // CHECK-MESSAGES: [[@LINE-1]]:17: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: if (MACRO_EQ(absl::FDivDuration(d, d), 0.0)) {}
+  if (CHECK(MACRO_EQ(d/d, 0.0))) {}
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: if (CHECK(MACRO_EQ(absl::FDivDuration(d, d), 0.0))) {}
+
+  // This one generates a message, but no fix.
+  if (MACRO_DIVEQ(d, d, 0.0)) {}
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: if (MACRO_DIVEQ(d, d, 0.0)) {}
+ 
+  TakesDouble(d/d);
+  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: operator/ on absl::Duration objects
+  // CHECK-FIXES: TakesDouble(absl::FDivDuration(d, d));
+}
+
+void TakesInt(int);
+template <class T>
+void TakesGeneric(T);
+
+void Negatives() {
+  absl::Duration d;
+  const int num_int = d/d;
+  const long num_long = d/d;
+  const short num_short = d/d;
+  const char num_char = d/d;
+  const auto num_auto = d/d;
+  const auto SomeVal = 1 + d/d;
+
+  TakesInt(d/d);
+  TakesGeneric(d/d);
+  // Explicit cast should disable the warning.
+  const double num_cast1 = static_cast<double>(d/d);
+  const double num_cast2 = (double)(d/d);
+}
+
+template <class T>
+double DoubleDivision(T t1, T t2) {return t1/t2;}
+
+//This also won't trigger a warning
+void TemplateDivision() {
+  absl::Duration d;
+  DoubleDivision(d, d);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-float.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-float.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-float.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-float.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,107 @@
+// RUN: %check_clang_tidy %s abseil-duration-factory-float %t -- -- -I%S/Inputs
+
+#include "absl/time/time.h"
+
+void ConvertFloatTest() {
+  absl::Duration d;
+
+  d = absl::Seconds(60.0);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(60);
+  d = absl::Minutes(300.0);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Minutes(300);
+
+  d = absl::Milliseconds(1e2);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Milliseconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Milliseconds(100);
+  d = absl::Seconds(3.0f);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(3);
+  d = absl::Seconds(3.);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(3);
+  d = absl::Seconds(0x3.p0);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(3);
+  d = absl::Seconds(0x3.p1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(6);
+
+
+  // Ignored expressions
+  d = absl::Seconds(.001);
+  d = absl::Seconds(.100);
+  d = ::absl::Seconds(1);
+  d = ::absl::Minutes(1);
+  d = ::absl::Hours(1);
+  d = absl::Seconds(0x3.4p1);
+
+  // Negative literals (we don't yet handle this case)
+  d = absl::Seconds(-3.0);
+
+  // This is bigger than we can safely fit in a positive int32, so we ignore it.
+  d = absl::Seconds(1e12);
+
+  int x;
+  d = absl::Seconds(x);
+  float y;
+  d = absl::Minutes(y);
+
+#define SECONDS(x) absl::Seconds(x)
+  SECONDS(60);
+#undef SECONDS
+#define THIRTY 30.0
+  d = absl::Seconds(THIRTY);
+#undef THIRTY
+}
+
+template <int N>
+void InTemplate() {
+  absl::Duration d;
+
+  d = absl::Seconds(N);  // 1
+  // ^ No replacement here.
+
+  d = absl::Minutes(1.0);  // 2
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Minutes(1);  // 2
+}
+
+void Instantiate() {
+  InTemplate<60>();
+  InTemplate<1>();
+}
+
+void ConvertCastTest() {
+  absl::Duration d;
+
+  d = absl::Seconds(static_cast<double>(5));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(5);
+
+  d = absl::Minutes(static_cast<float>(5));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Minutes(5);
+
+  d = absl::Seconds((double) 5);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(5);
+
+  d = absl::Minutes((float) 5);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Minutes(5);
+
+  d = absl::Seconds(double(5));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Seconds [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Seconds(5);
+
+  d = absl::Minutes(float(5));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: use the integer version of absl::Minutes [abseil-duration-factory-float]
+  // CHECK-FIXES: absl::Minutes(5);
+
+  // This should not be flagged
+  d = absl::Seconds(static_cast<int>(5.0));
+  d = absl::Seconds((int) 5.0);
+  d = absl::Seconds(int(5.0));
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-scale.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-scale.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-scale.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-factory-scale.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,118 @@
+// RUN: %check_clang_tidy %s abseil-duration-factory-scale %t -- -- -I%S/Inputs
+
+#include "absl/time/time.h"
+
+namespace std { typedef long long int64_t; }
+using int64_t = std::int64_t;
+
+void ScaleTest() {
+  absl::Duration d;
+
+  // Zeroes
+  d = absl::Hours(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Minutes(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Seconds(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Milliseconds(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Microseconds(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Nanoseconds(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Seconds(0.0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Seconds(0x0.000001p-126f);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Seconds(int{0});
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Seconds(int64_t{0});
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+  d = absl::Seconds(float{0});
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use ZeroDuration() for zero-length time intervals [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::ZeroDuration();
+
+  // Fold seconds into minutes
+  d = absl::Seconds(30 * 60);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Minutes(30);
+  d = absl::Seconds(60 * 30);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Minutes(30);
+
+  // Try a few more exotic multiplications
+  d = absl::Seconds(60 * 30 * 60);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Minutes(60 * 30);
+  d = absl::Seconds(1e-3 * 30);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Milliseconds(30);
+  d = absl::Milliseconds(30 * 1000);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Seconds(30);
+  d = absl::Milliseconds(30 * 0.001);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Microseconds(30);
+
+  // Multiple steps
+  d = absl::Seconds(5 * 3600);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Hours(5);
+  d = absl::Microseconds(5 * 1e6);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Seconds(5);
+  d = absl::Seconds(5 * 1e-6);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Microseconds(5);
+  d = absl::Microseconds(5 * 1000000);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Seconds(5);
+
+  // Division
+  d = absl::Hours(30 / 60.);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Minutes(30);
+  d = absl::Seconds(30 / 1000.);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Milliseconds(30);
+  d = absl::Milliseconds(30 / 1e3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Microseconds(30);
+  d = absl::Seconds(30 / 1e6);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: internal duration scaling can be removed [abseil-duration-factory-scale]
+  // CHECK-FIXES: absl::Microseconds(30);
+
+  // None of these should trigger the check
+  d = absl::Seconds(60);
+  d = absl::Seconds(int{60});
+  d = absl::Seconds(float{60});
+  d = absl::Seconds(60 + 30);
+  d = absl::Seconds(60 - 30);
+  d = absl::Seconds(50 * 30);
+  d = absl::Hours(60 * 60);
+  d = absl::Nanoseconds(1e-3 * 30);
+  d = absl::Seconds(1000 / 30);
+  // We don't support division by integers, which could cause rounding
+  d = absl::Seconds(10 / 1000);
+  d = absl::Seconds(30 / 50);
+
+#define EXPRESSION 30 * 60
+  d = absl::Seconds(EXPRESSION);
+#undef EXPRESSION
+
+// This should not trigger
+#define HOURS(x) absl::Minutes(60 * x)
+  d = HOURS(40);
+#undef HOURS
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-subtraction.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-subtraction.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-subtraction.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-subtraction.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,64 @@
+// RUN: %check_clang_tidy %s abseil-duration-subtraction %t -- -- -I %S/Inputs
+
+#include "absl/time/time.h"
+
+void f() {
+  double x;
+  absl::Duration d, d1, d2;
+
+  x = absl::ToDoubleSeconds(d) - 1.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(1))
+  x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(d1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleSeconds(d - d1);
+  x = absl::ToDoubleSeconds(d) - 6.5 - 8.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(6.5)) - 8.0;
+  x = absl::ToDoubleHours(d) - 1.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleHours(d - absl::Hours(1))
+  x = absl::ToDoubleMinutes(d) - 1;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleMinutes(d - absl::Minutes(1))
+  x = absl::ToDoubleMilliseconds(d) - 9;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleMilliseconds(d - absl::Milliseconds(9))
+  x = absl::ToDoubleMicroseconds(d) - 9;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleMicroseconds(d - absl::Microseconds(9))
+  x = absl::ToDoubleNanoseconds(d) - 42;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleNanoseconds(d - absl::Nanoseconds(42))
+
+  // We can rewrite the argument of the duration conversion
+#define THIRTY absl::Seconds(30)
+  x = absl::ToDoubleSeconds(THIRTY) - 1.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleSeconds(THIRTY - absl::Seconds(1))
+#undef THIRTY
+
+  // Some other contexts
+  if (absl::ToDoubleSeconds(d) - 1.0 > 10) {}
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: if (absl::ToDoubleSeconds(d - absl::Seconds(1)) > 10) {}
+
+  // A nested occurance
+  x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(absl::Seconds(5));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(5))
+  x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(absl::Seconds(absl::ToDoubleSeconds(d1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the duration domain [abseil-duration-subtraction]
+  // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(absl::ToDoubleSeconds(d1)))
+
+  // These should not match
+  x = 5 - 6;
+  x = 4 - absl::ToDoubleSeconds(d) - 6.5 - 8.0;
+  x = absl::ToDoubleSeconds(d) + 1.0;
+  x = absl::ToDoubleSeconds(d) * 1.0;
+  x = absl::ToDoubleSeconds(d) / 1.0;
+
+#define MINUS_FIVE(z) absl::ToDoubleSeconds(z) - 5
+  x = MINUS_FIVE(d);
+#undef MINUS_FIVE
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-unnecessary-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-unnecessary-conversion.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-unnecessary-conversion.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-duration-unnecessary-conversion.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,111 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-duration-unnecessary-conversion %t -- -- -I %S/Inputs
+
+#include "absl/time/time.h"
+
+void f() {
+  absl::Duration d1, d2;
+
+  // Floating point
+  d2 = absl::Hours(absl::ToDoubleHours(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Minutes(absl::ToDoubleMinutes(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Seconds(absl::ToDoubleSeconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Milliseconds(absl::ToDoubleMilliseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Microseconds(absl::ToDoubleMicroseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Nanoseconds(absl::ToDoubleNanoseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+
+  // Integer point
+  d2 = absl::Hours(absl::ToInt64Hours(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Minutes(absl::ToInt64Minutes(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Seconds(absl::ToInt64Seconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Milliseconds(absl::ToInt64Milliseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Microseconds(absl::ToInt64Microseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Nanoseconds(absl::ToInt64Nanoseconds(d1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+
+  d2 = absl::Hours(d1 / absl::Hours(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Minutes(d1 / absl::Minutes(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Seconds(d1 / absl::Seconds(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Milliseconds(d1 / absl::Milliseconds(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Microseconds(d1 / absl::Microseconds(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Nanoseconds(d1 / absl::Nanoseconds(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+
+  d2 = absl::Hours(absl::FDivDuration(d1, absl::Hours(1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Minutes(absl::FDivDuration(d1, absl::Minutes(1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Seconds(absl::FDivDuration(d1, absl::Seconds(1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Milliseconds(absl::FDivDuration(d1, absl::Milliseconds(1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Microseconds(absl::FDivDuration(d1, absl::Microseconds(1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+  d2 = absl::Nanoseconds(absl::FDivDuration(d1, absl::Nanoseconds(1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: d2 = d1
+
+  // As macro argument
+#define PLUS_FIVE_S(x) x + absl::Seconds(5)
+  d2 = PLUS_FIVE_S(absl::Seconds(absl::ToInt64Seconds(d1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: remove unnecessary absl::Duration conversions [abseil-duration-unnecessary-conversion]
+  // CHECK-FIXES: PLUS_FIVE_S(d1)
+#undef PLUS_FIVE_S
+
+  // Split by macro: should not change
+#define TOSECONDS(x) absl::Seconds(x)
+  d2 = TOSECONDS(absl::ToInt64Seconds(d1));
+#undef TOSECONDS
+
+  // Don't change something inside a macro definition
+#define VALUE(x) absl::Hours(absl::ToInt64Hours(x));
+  d2 = VALUE(d1);
+#undef VALUE
+
+  // These should not match
+  d2 = absl::Seconds(absl::ToDoubleMilliseconds(d1));
+  d2 = absl::Seconds(4);
+  int i = absl::ToInt64Milliseconds(d1);
+  d2 = absl::Hours(d1 / absl::Minutes(1));
+  d2 = absl::Seconds(d1 / absl::Seconds(30));
+  d2 = absl::Hours(absl::FDivDuration(d1, absl::Minutes(1)));
+  d2 = absl::Milliseconds(absl::FDivDuration(d1, absl::Milliseconds(20)));
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-faster-strsplit-delimiter.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-faster-strsplit-delimiter.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-faster-strsplit-delimiter.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-faster-strsplit-delimiter.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,125 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-faster-strsplit-delimiter %t
+// FIXME: Fix the checker to work in C++17 mode.
+
+namespace absl {
+
+class string_view {
+  public:
+    string_view();
+    string_view(const char *);
+};
+
+namespace strings_internal {
+struct Splitter {};
+struct MaxSplitsImpl {
+  MaxSplitsImpl();
+  ~MaxSplitsImpl();
+};
+} //namespace strings_internal
+
+template <typename Delim>
+strings_internal::Splitter StrSplit(absl::string_view, Delim) {
+  return {};
+}
+template <typename Delim, typename Pred>
+strings_internal::Splitter StrSplit(absl::string_view, Delim, Pred) {
+  return {};
+}
+
+class ByAnyChar {
+  public:
+    explicit ByAnyChar(absl::string_view);
+    ~ByAnyChar();
+};
+
+template <typename Delim>
+strings_internal::MaxSplitsImpl MaxSplits(Delim, int) {
+  return {};
+}
+
+} //namespace absl
+
+void SplitDelimiters() {
+  absl::StrSplit("ABC", "A");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", 'A');
+
+  absl::StrSplit("ABC", "\x01");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", '\x01');
+
+  absl::StrSplit("ABC", "\001");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", '\001');
+
+  absl::StrSplit("ABC", R"(A)");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", 'A');
+
+  absl::StrSplit("ABC", R"(')");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", '\'');
+
+  absl::StrSplit("ABC", R"(
+)");
+  // CHECK-MESSAGES: [[@LINE-2]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", '\n');
+
+  absl::StrSplit("ABC", R"delimiter(A)delimiter");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit() called with a string literal consisting of a single character; consider using the character overload [abseil-faster-strsplit-delimiter]
+  // CHECK-FIXES: absl::StrSplit("ABC", 'A');
+
+  absl::StrSplit("ABC", absl::ByAnyChar("\n"));
+  // CHECK-MESSAGES: [[@LINE-1]]:41: warning: absl::StrSplit()
+  // CHECK-FIXES: absl::StrSplit("ABC", '\n');
+
+  // Works with predicate
+  absl::StrSplit("ABC", "A", [](absl::string_view) { return true; });
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
+  // CHECK-FIXES: absl::StrSplit("ABC", 'A', [](absl::string_view) { return true; });
+
+  // Doesn't do anything with other strings lenghts.
+  absl::StrSplit("ABC", "AB");
+  absl::StrSplit("ABC", absl::ByAnyChar(""));
+  absl::StrSplit("ABC", absl::ByAnyChar(" \t"));
+
+  // Escapes a single quote in the resulting character literal.
+  absl::StrSplit("ABC", "'");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
+  // CHECK-FIXES: absl::StrSplit("ABC", '\'');
+
+  absl::StrSplit("ABC", "\"");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
+  // CHECK-FIXES: absl::StrSplit("ABC", '\"');
+
+  absl::StrSplit("ABC", absl::MaxSplits("\t", 1));
+  // CHECK-MESSAGES: [[@LINE-1]]:41: warning: absl::MaxSplits()
+  // CHECK-FIXES: absl::StrSplit("ABC", absl::MaxSplits('\t', 1));
+
+  auto delim = absl::MaxSplits(absl::ByAnyChar(" "), 1);
+  // CHECK-MESSAGES: [[@LINE-1]]:48: warning: absl::MaxSplits()
+  // CHECK-FIXES: auto delim = absl::MaxSplits(' ', 1);
+}
+
+#define MACRO(str) absl::StrSplit("ABC", str)
+
+void Macro() {
+  MACRO("A");
+}
+
+template <typename T>
+void FunctionTemplate() {
+  // This one should not warn because ByAnyChar is a dependent type.
+  absl::StrSplit("TTT", T("A"));
+
+  // This one will warn, but we are checking that we get a correct warning only
+  // once.
+  absl::StrSplit("TTT", "A");
+  // CHECK-MESSAGES: [[@LINE-1]]:25: warning: absl::StrSplit()
+  // CHECK-FIXES: absl::StrSplit("TTT", 'A');
+}
+
+void FunctionTemplateCaller() {
+  FunctionTemplate<absl::ByAnyChar>();
+  FunctionTemplate<absl::string_view>();
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,48 @@
+// RUN: %check_clang_tidy %s abseil-no-internal-dependencies %t,  -- -- -I %S/Inputs
+// RUN: clang-tidy -checks='-*, abseil-no-internal-dependencies' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s
+
+#include "absl/strings/internal-file.h"
+#include "absl/flags/internal-file.h"
+// CHECK-NOT: warning:
+
+#include "absl/external-file.h"
+// CHECK: absl/external-file.h:6:24: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil [abseil-no-internal-dependencies]
+
+void DirectAcess() {
+  absl::strings_internal::InternalFunction();
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
+
+  absl::strings_internal::InternalTemplateFunction<std::string>("a");
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
+}
+
+class FriendUsage {
+  friend struct absl::container_internal::InternalStruct;
+  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
+};
+
+namespace absl {
+void OpeningNamespace() {
+  strings_internal::InternalFunction();
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
+}
+} // namespace absl
+
+// should not trigger warnings
+void CorrectUsage() {
+  std::string Str = absl::StringsFunction("a");
+  absl::SomeContainer b;
+}
+
+namespace absl {
+SomeContainer b;
+std::string Str = absl::StringsFunction("a");
+} // namespace absl
+
+#define USE_EXTERNAL(x) absl::strings_internal::Internal##x()
+
+void MacroUse() {
+  USE_INTERNAL(Function); // no-warning
+  USE_EXTERNAL(Function);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not reference any 'internal' namespaces; those implementation details are reserved to Abseil
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-namespace.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-namespace.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-no-namespace.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -- -I %S/Inputs
+// RUN: clang-tidy -checks='-*, abseil-no-namespace' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s
+
+/// Warning will not be triggered on internal Abseil code that is included.
+#include "absl/strings/internal-file.h"
+// CHECK-NOT: warning:
+
+/// Warning will be triggered on code that is not internal that is included.
+#include "absl/external-file.h"
+// CHECK: absl/external-file.h:1:11: warning: namespace 'absl' is reserved
+
+namespace absl {}
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl' is reserved for implementation of the Abseil library and should not be opened in user code [abseil-no-namespace]
+
+namespace absl {
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl'
+namespace std {
+int i = 5;
+}
+}
+
+// Things that shouldn't trigger the check
+int i = 5;
+namespace std {}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-redundant-strcat-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-redundant-strcat-calls.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-redundant-strcat-calls.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-redundant-strcat-calls.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,188 @@
+// RUN: %check_clang_tidy %s abseil-redundant-strcat-calls %t
+
+int strlen(const char *);
+
+// Here we mimic the hierarchy of ::string.
+// We need to do so because we are matching on the fully qualified name of the
+// methods.
+struct __sso_string_base {};
+namespace __gnu_cxx {
+template <typename A, typename B, typename C, typename D = __sso_string_base>
+class __versa_string {
+ public:
+  const char *c_str() const;
+  const char *data() const;
+  int size() const;
+  int capacity() const;
+  int length() const;
+  bool empty() const;
+  char &operator[](int);
+  void clear();
+  void resize(int);
+  int compare(const __versa_string &) const;
+};
+}  // namespace __gnu_cxx
+
+namespace std {
+template <typename T>
+class char_traits {};
+template <typename T>
+class allocator {};
+}  // namespace std
+
+template <typename A, typename B = std::char_traits<A>,
+          typename C = std::allocator<A>>
+class basic_string : public __gnu_cxx::__versa_string<A, B, C> {
+ public:
+  basic_string();
+  basic_string(const basic_string &);
+  basic_string(const char *, C = C());
+  basic_string(const char *, int, C = C());
+  basic_string(const basic_string &, int, int, C = C());
+  ~basic_string();
+
+  basic_string &operator+=(const basic_string &);
+};
+
+template <typename A, typename B, typename C>
+basic_string<A, B, C> operator+(const basic_string<A, B, C> &,
+                                const basic_string<A, B, C> &);
+template <typename A, typename B, typename C>
+basic_string<A, B, C> operator+(const basic_string<A, B, C> &, const char *);
+
+typedef basic_string<char> string;
+
+bool operator==(const string &, const string &);
+bool operator==(const string &, const char *);
+bool operator==(const char *, const string &);
+
+bool operator!=(const string &, const string &);
+bool operator<(const string &, const string &);
+bool operator>(const string &, const string &);
+bool operator<=(const string &, const string &);
+bool operator>=(const string &, const string &);
+
+namespace std {
+template <typename _CharT, typename _Traits = char_traits<_CharT>,
+          typename _Alloc = allocator<_CharT>>
+class basic_string;
+
+template <typename _CharT, typename _Traits, typename _Alloc>
+class basic_string {
+ public:
+  basic_string();
+  basic_string(const basic_string &);
+  basic_string(const char *, const _Alloc & = _Alloc());
+  basic_string(const char *, int, const _Alloc & = _Alloc());
+  basic_string(const basic_string &, int, int, const _Alloc & = _Alloc());
+  ~basic_string();
+
+  basic_string &operator+=(const basic_string &);
+
+  unsigned size() const;
+  unsigned length() const;
+  bool empty() const;
+};
+
+typedef basic_string<char> string;
+}  // namespace std
+
+namespace absl {
+
+class string_view {
+ public:
+  typedef std::char_traits<char> traits_type;
+
+  string_view();
+  string_view(const char *);
+  string_view(const string &);
+  string_view(const char *, int);
+  string_view(string_view, int);
+
+  template <typename A>
+  explicit operator ::basic_string<char, traits_type, A>() const;
+
+  const char *data() const;
+  int size() const;
+  int length() const;
+};
+
+bool operator==(string_view A, string_view B);
+
+struct AlphaNum {
+  AlphaNum(int i);
+  AlphaNum(double f);
+  AlphaNum(const char *c_str);
+  AlphaNum(const string &str);
+  AlphaNum(const string_view &pc);
+
+ private:
+  AlphaNum(const AlphaNum &);
+  AlphaNum &operator=(const AlphaNum &);
+};
+
+string StrCat(const AlphaNum &A);
+string StrCat(const AlphaNum &A, const AlphaNum &B);
+string StrCat(const AlphaNum &A, const AlphaNum &B, const AlphaNum &C);
+string StrCat(const AlphaNum &A, const AlphaNum &B, const AlphaNum &C,
+              const AlphaNum &D);
+
+// Support 5 or more arguments
+template <typename... AV>
+string StrCat(const AlphaNum &A, const AlphaNum &B, const AlphaNum &C,
+              const AlphaNum &D, const AlphaNum &E, const AV &... args);
+
+void StrAppend(string *Dest, const AlphaNum &A);
+void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B);
+void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B,
+               const AlphaNum &C);
+void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B,
+               const AlphaNum &C, const AlphaNum &D);
+
+// Support 5 or more arguments
+template <typename... AV>
+void StrAppend(string *Dest, const AlphaNum &A, const AlphaNum &B,
+               const AlphaNum &C, const AlphaNum &D, const AlphaNum &E,
+               const AV &... args);
+
+}  // namespace absl
+
+using absl::AlphaNum;
+using absl::StrAppend;
+using absl::StrCat;
+
+void Positives() {
+  string S = StrCat(1, StrCat("A", StrCat(1.1)));
+  // CHECK-MESSAGES: [[@LINE-1]]:14: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
+
+  S = StrCat(StrCat(StrCat(StrCat(StrCat(1)))));
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
+
+  // TODO: should trigger. The issue here is that in the current
+  // implementation we ignore any StrCat with StrCat ancestors. Therefore
+  // inserting anything in between calls will disable triggering the deepest
+  // ones.
+  // s = StrCat(Identity(StrCat(StrCat(1, 2), StrCat(3, 4))));
+
+  StrAppend(&S, 001, StrCat(1, 2, "3"), StrCat("FOO"));
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
+
+  StrAppend(&S, 001, StrCat(StrCat(1, 2), "3"), StrCat("FOO"));
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
+
+  // Too many args. Ignore for now.
+  S = StrCat(1, 2, StrCat(3, 4, 5, 6, 7), 8, 9, 10,
+             StrCat(11, 12, 13, 14, 15, 16, 17, 18), 19, 20, 21, 22, 23, 24, 25,
+             26, 27);
+  // CHECK-MESSAGES: :[[@LINE-3]]:7: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
+  StrAppend(&S, StrCat(1, 2, 3, 4, 5), StrCat(6, 7, 8, 9, 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: multiple calls to 'absl::StrCat' can be flattened into a single call
+}
+
+void Negatives() {
+  // One arg. It is used for conversion. Ignore.
+  string S = StrCat(1);
+
+#define A_MACRO(x, y, z) StrCat(x, y, z)
+  S = A_MACRO(1, 2, StrCat("A", "B"));
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-str-cat-append.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-str-cat-append.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-str-cat-append.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-str-cat-append.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,129 @@
+// RUN: %check_clang_tidy %s abseil-str-cat-append %t
+
+typedef unsigned __INT16_TYPE__ char16;
+typedef unsigned __INT32_TYPE__ char32;
+typedef __SIZE_TYPE__ size;
+
+namespace std {
+template <typename T>
+class allocator {};
+template <typename T>
+class char_traits {};
+template <typename C, typename T, typename A>
+struct basic_string {
+  typedef basic_string<C, T, A> _Type;
+  basic_string();
+  basic_string(const C* p, const A& a = A());
+
+  const C* c_str() const;
+  const C* data() const;
+
+  _Type& append(const C* s);
+  _Type& append(const C* s, size n);
+  _Type& assign(const C* s);
+  _Type& assign(const C* s, size n);
+
+  int compare(const _Type&) const;
+  int compare(const C* s) const;
+  int compare(size pos, size len, const _Type&) const;
+  int compare(size pos, size len, const C* s) const;
+
+  size find(const _Type& str, size pos = 0) const;
+  size find(const C* s, size pos = 0) const;
+  size find(const C* s, size pos, size n) const;
+
+  _Type& insert(size pos, const _Type& str);
+  _Type& insert(size pos, const C* s);
+  _Type& insert(size pos, const C* s, size n);
+
+  _Type& operator+=(const _Type& str);
+  _Type& operator+=(const C* s);
+  _Type& operator=(const _Type& str);
+  _Type& operator=(const C* s);
+};
+
+typedef basic_string<char, std::char_traits<char>, std::allocator<char>> string;
+typedef basic_string<wchar_t, std::char_traits<wchar_t>,
+                     std::allocator<wchar_t>>
+    wstring;
+typedef basic_string<char16, std::char_traits<char16>, std::allocator<char16>>
+    u16string;
+typedef basic_string<char32, std::char_traits<char32>, std::allocator<char32>>
+    u32string;
+}  // namespace std
+
+std::string operator+(const std::string&, const std::string&);
+std::string operator+(const std::string&, const char*);
+std::string operator+(const char*, const std::string&);
+
+bool operator==(const std::string&, const std::string&);
+bool operator==(const std::string&, const char*);
+bool operator==(const char*, const std::string&);
+
+namespace llvm {
+struct StringRef {
+  StringRef(const char* p);
+  StringRef(const std::string&);
+};
+}  // namespace llvm
+
+namespace absl {
+
+struct AlphaNum {
+  AlphaNum(int i);
+  AlphaNum(double f);
+  AlphaNum(const char* c_str);
+  AlphaNum(const std::string& str);
+
+ private:
+  AlphaNum(const AlphaNum&);
+  AlphaNum& operator=(const AlphaNum&);
+};
+
+std::string StrCat(const AlphaNum& A);
+std::string StrCat(const AlphaNum& A, const AlphaNum& B);
+
+template <typename A>
+void Foo(A& a) {
+  a = StrCat(a);
+}
+
+void Bar() {
+  std::string A, B;
+  Foo<std::string>(A);
+
+  std::string C = StrCat(A);
+  A = StrCat(A);
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: call to 'absl::StrCat' has no effect
+  A = StrCat(A, B);
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
+// CHECK-FIXES: {{^}}  absl::StrAppend(&A, B);
+  B = StrCat(A, B);
+
+#define M(X) X = StrCat(X, A)
+  M(B);
+// CHECK-MESSAGES: [[@LINE-1]]:5: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
+// CHECK-FIXES: #define M(X) X = StrCat(X, A)
+}
+
+void Regression_SelfAppend() {
+  std::string A;
+  A = StrCat(A, A);
+}
+
+}  // namespace absl
+
+void OutsideAbsl() {
+  std::string A, B;
+  A = absl::StrCat(A, B);
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
+// CHECK-FIXES: {{^}}  absl::StrAppend(&A, B);
+}
+
+void OutsideUsingAbsl() {
+  std::string A, B;
+  using absl::StrCat;
+  A = StrCat(A, B);
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: call 'absl::StrAppend' instead of 'absl::StrCat' when appending to a string to avoid a performance penalty
+// CHECK-FIXES: {{^}}  absl::StrAppend(&A, B);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-string-find-startswith.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-string-find-startswith.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-string-find-startswith.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-string-find-startswith.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,69 @@
+// RUN: %check_clang_tidy %s abseil-string-find-startswith %t -- \
+// RUN:   -config="{CheckOptions: [{key: 'abseil-string-find-startswith.StringLikeClasses', value: '::std::basic_string;::basic_string'}]}"
+
+namespace std {
+template <typename T> class allocator {};
+template <typename T> class char_traits {};
+template <typename C, typename T = std::char_traits<C>,
+          typename A = std::allocator<C>>
+struct basic_string {
+  basic_string();
+  basic_string(const basic_string &);
+  basic_string(const C *, const A &a = A());
+  ~basic_string();
+  int find(basic_string<C> s, int pos = 0);
+  int find(const char *s, int pos = 0);
+};
+typedef basic_string<char> string;
+typedef basic_string<wchar_t> wstring;
+
+struct cxx_string {
+  int find(const char *s, int pos = 0);
+};
+} // namespace std
+
+struct basic_string : public std::cxx_string {
+  basic_string();
+};
+typedef basic_string global_string;
+
+std::string foo(std::string);
+std::string bar();
+
+#define A_MACRO(x, y) ((x) == (y))
+
+void tests(std::string s, global_string s2) {
+  s.find("a") == 0;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith instead of find() == 0 [abseil-string-find-startswith]
+  // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, "a");{{$}}
+
+  s.find(s) == 0;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
+  // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s, s);{{$}}
+
+  s.find("aaa") != 0;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
+  // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "aaa");{{$}}
+
+  s.find(foo(foo(bar()))) != 0;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
+  // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, foo(foo(bar())));{{$}}
+
+  if (s.find("....") == 0) { /* do something */ }
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use absl::StartsWith
+  // CHECK-FIXES: {{^[[:space:]]*}}if (absl::StartsWith(s, "....")) { /* do something */ }{{$}}
+
+  0 != s.find("a");
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use !absl::StartsWith
+  // CHECK-FIXES: {{^[[:space:]]*}}!absl::StartsWith(s, "a");{{$}}
+
+  s2.find("a") == 0;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith
+  // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s2, "a");{{$}}
+
+  // expressions that don't trigger the check are here.
+  A_MACRO(s.find("a"), 0);
+  s.find("a", 1) == 0;
+  s.find("a", 1) == 1;
+  s.find("a") == 1;
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-comparison.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-comparison.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-comparison.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-comparison.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,129 @@
+// RUN: %check_clang_tidy %s abseil-time-comparison %t -- -- -I%S/Inputs
+
+#include "absl/time/time.h"
+
+void f() {
+  double x;
+  absl::Duration d1, d2;
+  bool b;
+  absl::Time t1, t2;
+
+  // Check against the RHS
+  b = x > absl::ToUnixSeconds(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixSeconds(x) > t1;
+  b = x >= absl::ToUnixSeconds(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixSeconds(x) >= t1;
+  b = x == absl::ToUnixSeconds(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixSeconds(x) == t1;
+  b = x <= absl::ToUnixSeconds(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixSeconds(x) <= t1;
+  b = x < absl::ToUnixSeconds(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixSeconds(x) < t1;
+  b = x == absl::ToUnixSeconds(t1 - d2);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixSeconds(x) == t1 - d2;
+  b = absl::ToUnixSeconds(t1) > absl::ToUnixSeconds(t2);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 > t2;
+
+  // Check against the LHS
+  b = absl::ToUnixSeconds(t1) < x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 < absl::FromUnixSeconds(x);
+  b = absl::ToUnixSeconds(t1) <= x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 <= absl::FromUnixSeconds(x);
+  b = absl::ToUnixSeconds(t1) == x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 == absl::FromUnixSeconds(x);
+  b = absl::ToUnixSeconds(t1) >= x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 >= absl::FromUnixSeconds(x);
+  b = absl::ToUnixSeconds(t1) > x;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 > absl::FromUnixSeconds(x);
+
+  // Comparison against zero
+  b = absl::ToUnixSeconds(t1) < 0.0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 < absl::UnixEpoch();
+  b = absl::ToUnixSeconds(t1) < 0;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: t1 < absl::UnixEpoch();
+
+  // Scales other than Seconds
+  b = x > absl::ToUnixMicros(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixMicros(x) > t1;
+  b = x >= absl::ToUnixMillis(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixMillis(x) >= t1;
+  b = x == absl::ToUnixNanos(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixNanos(x) == t1;
+  b = x <= absl::ToUnixMinutes(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixMinutes(x) <= t1;
+  b = x < absl::ToUnixHours(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixHours(x) < t1;
+
+  // A long expression
+  bool some_condition;
+  int very_very_very_very_long_variable_name;
+  absl::Time SomeTime;
+  if (some_condition && very_very_very_very_long_variable_name
+     < absl::ToUnixSeconds(SomeTime)) {
+  // CHECK-MESSAGES: [[@LINE-2]]:25: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: if (some_condition && absl::FromUnixSeconds(very_very_very_very_long_variable_name) < SomeTime) {
+    return;
+  }
+
+  // A complex expression
+  int y;
+  b = (y + 5) * 10 > absl::ToUnixMillis(t1);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: absl::FromUnixMillis((y + 5) * 10) > t1;
+
+  // We should still transform the expression inside this macro invocation
+#define VALUE_IF(v, e) v ? (e) : 0
+  int a = VALUE_IF(1, 5 > absl::ToUnixSeconds(t1));
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: VALUE_IF(1, absl::FromUnixSeconds(5) > t1);
+#undef VALUE_IF
+
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e) v ? VALUE_IF_2(e) : VALUE_IF_2(0)
+  int a2 = VALUE_IF(1, 5 > absl::ToUnixSeconds(t1));
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: perform comparison in the time domain [abseil-time-comparison]
+  // CHECK-FIXES: VALUE_IF(1, absl::FromUnixSeconds(5) > t1);
+#undef VALUE_IF
+#undef VALUE_IF_2
+
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e, type) (v ? VALUE_IF_2(absl::To##type##Seconds(e)) : 0)
+  int a3 = VALUE_IF(1, t1, Unix);
+#undef VALUE_IF
+#undef VALUE_IF_2
+
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e, type) (v ? (5 > VALUE_IF_2(absl::To##type##Seconds(e))) : 0)
+  int a4 = VALUE_IF(1, t1, Unix);
+#undef VALUE_IF
+#undef VALUE_IF_2
+
+  // These should not match
+  b = 6 < 4;
+
+#define TODOUBLE(x) absl::ToUnixSeconds(x)
+  b = 5.0 > TODOUBLE(t1);
+#undef TODOUBLE
+#define THIRTY 30.0
+  b = THIRTY > absl::ToUnixSeconds(t1);
+#undef THIRTY
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-subtraction.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-subtraction.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-subtraction.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-time-subtraction.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,118 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-time-subtraction %t -- -- -I %S/Inputs
+// FIXME: Fix the checker to work in C++17 mode.
+
+#include "absl/time/time.h"
+
+void g(absl::Duration d);
+
+void f() {
+  absl::Time t;
+  int x, y;
+  absl::Duration d;
+
+  d = absl::Hours(absl::ToUnixHours(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixHours(x));
+  d = absl::Minutes(absl::ToUnixMinutes(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixMinutes(x));
+  d = absl::Seconds(absl::ToUnixSeconds(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixSeconds(x));
+  d = absl::Milliseconds(absl::ToUnixMillis(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixMillis(x));
+  d = absl::Microseconds(absl::ToUnixMicros(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixMicros(x));
+  d = absl::Nanoseconds(absl::ToUnixNanos(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixNanos(x));
+
+  y = x - absl::ToUnixHours(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: y = absl::ToInt64Hours(absl::FromUnixHours(x) - t);
+  y = x - absl::ToUnixMinutes(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: y = absl::ToInt64Minutes(absl::FromUnixMinutes(x) - t);
+  y = x - absl::ToUnixSeconds(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: y = absl::ToInt64Seconds(absl::FromUnixSeconds(x) - t);
+  y = x - absl::ToUnixMillis(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: y = absl::ToInt64Milliseconds(absl::FromUnixMillis(x) - t);
+  y = x - absl::ToUnixMicros(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: y = absl::ToInt64Microseconds(absl::FromUnixMicros(x) - t);
+  y = x - absl::ToUnixNanos(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: y = absl::ToInt64Nanoseconds(absl::FromUnixNanos(x) - t);
+
+  // Check parenthesis placement
+  d = 5 * absl::Seconds(absl::ToUnixSeconds(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = 5 * (t - absl::FromUnixSeconds(x));
+  d = absl::Seconds(absl::ToUnixSeconds(t) - x) / 5;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixSeconds(x)) / 5;
+
+  // No extra parens around arguments
+  g(absl::Seconds(absl::ToUnixSeconds(t) - x));
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: g(t - absl::FromUnixSeconds(x));
+  g(absl::Seconds(x - absl::ToUnixSeconds(t)));
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: g(absl::FromUnixSeconds(x) - t);
+
+  // More complex subexpressions
+  d = absl::Hours(absl::ToUnixHours(t) - 5 * x);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: d = (t - absl::FromUnixHours(5 * x));
+
+  // These should not trigger; they are likely bugs
+  d = absl::Milliseconds(absl::ToUnixSeconds(t) - x);
+  d = absl::Seconds(absl::ToUnixMicros(t) - x);
+
+  // Various macro scenarios
+#define SUB(z, t1) z - absl::ToUnixSeconds(t1)
+  y = SUB(x, t);
+#undef SUB
+
+#define MILLIS(t1) absl::ToUnixMillis(t1)
+  y = x - MILLIS(t);
+#undef MILLIS
+
+#define HOURS(z) absl::Hours(z)
+  d = HOURS(absl::ToUnixHours(t) - x);
+#undef HOURS
+
+  // This should match the expression inside the macro invocation.
+#define SECONDS(z) absl::Seconds(z)
+  d = SECONDS(x - absl::ToUnixSeconds(t));
+  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: SECONDS(absl::ToInt64Seconds(absl::FromUnixSeconds(x) - t))
+#undef SECONDS
+}
+
+template<typename T>
+void func(absl::Time t, T x) {
+  absl::Duration d = absl::Seconds(absl::ToUnixSeconds(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:22: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: absl::Duration d = t - absl::FromUnixSeconds(x);
+}
+
+void g() {
+  func(absl::Now(), 5);
+}
+
+absl::Duration parens_in_return() {
+  absl::Time t;
+  int x;
+
+  return absl::Seconds(absl::ToUnixSeconds(t) - x);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: return t - absl::FromUnixSeconds(x);
+  return absl::Seconds(x - absl::ToUnixSeconds(t));
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: perform subtraction in the time domain [abseil-time-subtraction]
+  // CHECK-FIXES: return absl::FromUnixSeconds(x) - t;
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-upgrade-duration-conversions.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-upgrade-duration-conversions.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-upgrade-duration-conversions.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/abseil-upgrade-duration-conversions.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,466 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-upgrade-duration-conversions %t -- -- -I%S/Inputs
+// FIXME: Fix the checker to work in C++17 mode.
+
+using int64_t = long long;
+
+#include "absl/time/time.h"
+
+template <typename T> struct ConvertibleTo {
+  operator T() const;
+};
+
+template <typename T>
+ConvertibleTo<T> operator+(ConvertibleTo<T>, ConvertibleTo<T>);
+
+template <typename T>
+ConvertibleTo<T> operator*(ConvertibleTo<T>, ConvertibleTo<T>);
+
+void arithmeticOperatorBasicPositive() {
+  absl::Duration d;
+  d *= ConvertibleTo<int64_t>();
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int64_t>());
+  d /= ConvertibleTo<int64_t>();
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d /= static_cast<int64_t>(ConvertibleTo<int64_t>());
+  d = ConvertibleTo<int64_t>() * d;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = static_cast<int64_t>(ConvertibleTo<int64_t>()) * d;
+  d = d * ConvertibleTo<int64_t>();
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = d * static_cast<int64_t>(ConvertibleTo<int64_t>());
+  d = d / ConvertibleTo<int64_t>();
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = d / static_cast<int64_t>(ConvertibleTo<int64_t>());
+  d.operator*=(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d.operator*=(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  d.operator/=(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d.operator/=(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  d = operator*(ConvertibleTo<int64_t>(), d);
+  // CHECK-MESSAGES: [[@LINE-1]]:17: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = operator*(static_cast<int64_t>(ConvertibleTo<int64_t>()), d);
+  d = operator*(d, ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = operator*(d, static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  d = operator/(d, ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = operator/(d, static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  ConvertibleTo<int64_t> c;
+  d *= (c + c) * c + c;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>((c + c) * c + c)
+  d /= (c + c) * c + c;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d /= static_cast<int64_t>((c + c) * c + c)
+  d = d * c * c;
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = d * static_cast<int64_t>(c) * static_cast<int64_t>(c)
+  d = c * d * c;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = static_cast<int64_t>(c) * d * static_cast<int64_t>(c)
+  d = d / c * c;
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = d / static_cast<int64_t>(c) * static_cast<int64_t>(c)
+}
+
+void arithmeticOperatorBasicNegative() {
+  absl::Duration d;
+  d *= char{1};
+  d *= 1;
+  d *= int64_t{1};
+  d *= 1.0f;
+  d *= 1.0;
+  d *= 1.0l;
+  d /= char{1};
+  d /= 1;
+  d /= int64_t{1};
+  d /= 1.0f;
+  d /= 1.0;
+  d /= 1.0l;
+  d = d * char{1};
+  d = d * 1;
+  d = d * int64_t{1};
+  d = d * 1.0f;
+  d = d * 1.0;
+  d = d * 1.0l;
+  d = char{1} * d;
+  d = 1 * d;
+  d = int64_t{1} * d;
+  d = 1.0f * d;
+  d = 1.0 * d;
+  d = 1.0l * d;
+  d = d / char{1};
+  d = d / 1;
+  d = d / int64_t{1};
+  d = d / 1.0f;
+  d = d / 1.0;
+  d = d / 1.0l;
+
+  d *= static_cast<int>(ConvertibleTo<int>());
+  d *= (int)ConvertibleTo<int>();
+  d *= int(ConvertibleTo<int>());
+  d /= static_cast<int>(ConvertibleTo<int>());
+  d /= (int)ConvertibleTo<int>();
+  d /= int(ConvertibleTo<int>());
+  d = static_cast<int>(ConvertibleTo<int>()) * d;
+  d = (int)ConvertibleTo<int>() * d;
+  d = int(ConvertibleTo<int>()) * d;
+  d = d * static_cast<int>(ConvertibleTo<int>());
+  d = d * (int)ConvertibleTo<int>();
+  d = d * int(ConvertibleTo<int>());
+  d = d / static_cast<int>(ConvertibleTo<int>());
+  d = d / (int)ConvertibleTo<int>();
+  d = d / int(ConvertibleTo<int>());
+
+  d *= 1 + ConvertibleTo<int>();
+  d /= 1 + ConvertibleTo<int>();
+  d = (1 + ConvertibleTo<int>()) * d;
+  d = d * (1 + ConvertibleTo<int>());
+  d = d / (1 + ConvertibleTo<int>());
+}
+
+template <typename T> void templateForOpsSpecialization(T) {}
+template <>
+void templateForOpsSpecialization<absl::Duration>(absl::Duration d) {
+  d *= ConvertibleTo<int64_t>();
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int64_t>());
+}
+
+template <int N> void arithmeticNonTypeTemplateParamSpecialization() {
+  absl::Duration d;
+  d *= N;
+}
+
+template <> void arithmeticNonTypeTemplateParamSpecialization<5>() {
+  absl::Duration d;
+  d *= ConvertibleTo<int>();
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int>());
+}
+
+template <typename T> void templateOpsFix() {
+  absl::Duration d;
+  d *= ConvertibleTo<int64_t>();
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(ConvertibleTo<int64_t>());
+}
+
+template <typename T, typename U> void templateOpsWarnOnly(T t, U u) {
+  t *= u;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  absl::Duration d;
+  d *= u;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+}
+
+template <typename T> struct TemplateTypeOpsWarnOnly {
+  void memberA(T t) {
+    d *= t;
+    // CHECK-MESSAGES: [[@LINE-1]]:10: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  }
+  template <typename U, typename V> void memberB(U u, V v) {
+    u *= v;
+    // CHECK-MESSAGES: [[@LINE-1]]:10: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+    d *= v;
+    // CHECK-MESSAGES: [[@LINE-1]]:10: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  }
+
+  absl::Duration d;
+};
+
+template <typename T, typename U>
+void templateOpsInstantiationBeforeDefinition(T t, U u);
+
+void arithmeticOperatorsInTemplates() {
+  templateForOpsSpecialization(5);
+  templateForOpsSpecialization(absl::Duration());
+  arithmeticNonTypeTemplateParamSpecialization<1>();
+  arithmeticNonTypeTemplateParamSpecialization<5>();
+  templateOpsFix<int>();
+  templateOpsWarnOnly(absl::Duration(), ConvertibleTo<int>());
+  templateOpsInstantiationBeforeDefinition(absl::Duration(),
+                                           ConvertibleTo<int>());
+  TemplateTypeOpsWarnOnly<ConvertibleTo<int>> t;
+  t.memberA(ConvertibleTo<int>());
+  t.memberB(absl::Duration(), ConvertibleTo<int>());
+}
+
+template <typename T, typename U>
+void templateOpsInstantiationBeforeDefinition(T t, U u) {
+  t *= u;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  absl::Duration d;
+  d *= u;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+}
+
+#define FUNCTION_MACRO(x) x
+#define CONVERTIBLE_TMP ConvertibleTo<int>()
+#define ONLY_WARN_INSIDE_MACRO_ARITHMETIC_OP d *= ConvertibleTo<int>()
+
+#define T_OBJECT T()
+#define T_CALL_EXPR d *= T()
+
+template <typename T> void arithmeticTemplateAndMacro() {
+  absl::Duration d;
+  d *= T_OBJECT;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  d *= CONVERTIBLE_TMP;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(CONVERTIBLE_TMP);
+  T_CALL_EXPR;
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+}
+
+#define TEMPLATE_MACRO(type)                                                   \
+  template <typename T> void TemplateInMacro(T t) {                            \
+    type d;                                                                    \
+    d *= t;                                                                    \
+  }
+
+TEMPLATE_MACRO(absl::Duration)
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+
+void arithmeticOperatorsInMacros() {
+  absl::Duration d;
+  d = FUNCTION_MACRO(d * ConvertibleTo<int>());
+  // CHECK-MESSAGES: [[@LINE-1]]:26: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d = FUNCTION_MACRO(d * static_cast<int64_t>(ConvertibleTo<int>()));
+  d *= FUNCTION_MACRO(ConvertibleTo<int>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(FUNCTION_MACRO(ConvertibleTo<int>()));
+  d *= CONVERTIBLE_TMP;
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: d *= static_cast<int64_t>(CONVERTIBLE_TMP);
+  ONLY_WARN_INSIDE_MACRO_ARITHMETIC_OP;
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  arithmeticTemplateAndMacro<ConvertibleTo<int>>();
+  TemplateInMacro(ConvertibleTo<int>());
+}
+
+void factoryFunctionPositive() {
+  // User defined conversion:
+  (void)absl::Nanoseconds(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  (void)absl::Microseconds(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Microseconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  (void)absl::Milliseconds(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Milliseconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  (void)absl::Seconds(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Seconds(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  (void)absl::Minutes(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Minutes(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+  (void)absl::Hours(ConvertibleTo<int64_t>());
+  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Hours(static_cast<int64_t>(ConvertibleTo<int64_t>()));
+
+  // User defined conversion to integral type, followed by built-in conversion:
+  (void)absl::Nanoseconds(ConvertibleTo<char>());
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<char>()));
+  (void)absl::Microseconds(ConvertibleTo<char>());
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Microseconds(static_cast<int64_t>(ConvertibleTo<char>()));
+  (void)absl::Milliseconds(ConvertibleTo<char>());
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Milliseconds(static_cast<int64_t>(ConvertibleTo<char>()));
+  (void)absl::Seconds(ConvertibleTo<char>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Seconds(static_cast<int64_t>(ConvertibleTo<char>()));
+  (void)absl::Minutes(ConvertibleTo<char>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Minutes(static_cast<int64_t>(ConvertibleTo<char>()));
+  (void)absl::Hours(ConvertibleTo<char>());
+  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Hours(static_cast<int64_t>(ConvertibleTo<char>()));
+
+  // User defined conversion to floating point type, followed by built-in conversion:
+  (void)absl::Nanoseconds(ConvertibleTo<float>());
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<float>()));
+  (void)absl::Microseconds(ConvertibleTo<float>());
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Microseconds(static_cast<int64_t>(ConvertibleTo<float>()));
+  (void)absl::Milliseconds(ConvertibleTo<float>());
+  // CHECK-MESSAGES: [[@LINE-1]]:28: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Milliseconds(static_cast<int64_t>(ConvertibleTo<float>()));
+  (void)absl::Seconds(ConvertibleTo<float>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Seconds(static_cast<int64_t>(ConvertibleTo<float>()));
+  (void)absl::Minutes(ConvertibleTo<float>());
+  // CHECK-MESSAGES: [[@LINE-1]]:23: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Minutes(static_cast<int64_t>(ConvertibleTo<float>()));
+  (void)absl::Hours(ConvertibleTo<float>());
+  // CHECK-MESSAGES: [[@LINE-1]]:21: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Hours(static_cast<int64_t>(ConvertibleTo<float>()));
+}
+
+void factoryFunctionNegative() {
+  (void)absl::Nanoseconds(char{1});
+  (void)absl::Nanoseconds(1);
+  (void)absl::Nanoseconds(int64_t{1});
+  (void)absl::Nanoseconds(1.0f);
+  (void)absl::Microseconds(char{1});
+  (void)absl::Microseconds(1);
+  (void)absl::Microseconds(int64_t{1});
+  (void)absl::Microseconds(1.0f);
+  (void)absl::Milliseconds(char{1});
+  (void)absl::Milliseconds(1);
+  (void)absl::Milliseconds(int64_t{1});
+  (void)absl::Milliseconds(1.0f);
+  (void)absl::Seconds(char{1});
+  (void)absl::Seconds(1);
+  (void)absl::Seconds(int64_t{1});
+  (void)absl::Seconds(1.0f);
+  (void)absl::Minutes(char{1});
+  (void)absl::Minutes(1);
+  (void)absl::Minutes(int64_t{1});
+  (void)absl::Minutes(1.0f);
+  (void)absl::Hours(char{1});
+  (void)absl::Hours(1);
+  (void)absl::Hours(int64_t{1});
+  (void)absl::Hours(1.0f);
+
+  (void)absl::Nanoseconds(static_cast<int>(ConvertibleTo<int>()));
+  (void)absl::Microseconds(static_cast<int>(ConvertibleTo<int>()));
+  (void)absl::Milliseconds(static_cast<int>(ConvertibleTo<int>()));
+  (void)absl::Seconds(static_cast<int>(ConvertibleTo<int>()));
+  (void)absl::Minutes(static_cast<int>(ConvertibleTo<int>()));
+  (void)absl::Hours(static_cast<int>(ConvertibleTo<int>()));
+}
+
+template <typename T> void templateForFactorySpecialization(T) {}
+template <> void templateForFactorySpecialization<ConvertibleTo<int>>(ConvertibleTo<int> c) {
+  (void)absl::Nanoseconds(c);
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(c));
+}
+
+template <int N> void factoryNonTypeTemplateParamSpecialization() {
+  (void)absl::Nanoseconds(N);
+}
+
+template <> void factoryNonTypeTemplateParamSpecialization<5>() {
+  (void)absl::Nanoseconds(ConvertibleTo<int>());
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<int>()));
+}
+
+template <typename T> void templateFactoryFix() {
+  (void)absl::Nanoseconds(ConvertibleTo<int>());
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(ConvertibleTo<int>()));
+}
+
+template <typename T> void templateFactoryWarnOnly(T t) {
+  (void)absl::Nanoseconds(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+}
+
+template <typename T> void templateFactoryInstantiationBeforeDefinition(T t);
+
+template <typename T> struct TemplateTypeFactoryWarnOnly {
+  void memberA(T t) {
+    (void)absl::Nanoseconds(t);
+    // CHECK-MESSAGES: [[@LINE-1]]:29: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  }
+  template <typename U> void memberB(U u) {
+    (void)absl::Nanoseconds(u);
+    // CHECK-MESSAGES: [[@LINE-1]]:29: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  }
+};
+
+void factoryInTemplates() {
+  templateForFactorySpecialization(5);
+  templateForFactorySpecialization(ConvertibleTo<int>());
+  factoryNonTypeTemplateParamSpecialization<1>();
+  factoryNonTypeTemplateParamSpecialization<5>();
+  templateFactoryFix<int>();
+  templateFactoryWarnOnly(ConvertibleTo<int>());
+  templateFactoryInstantiationBeforeDefinition(ConvertibleTo<int>());
+  TemplateTypeFactoryWarnOnly<ConvertibleTo<int>> t;
+  t.memberA(ConvertibleTo<int>());
+  t.memberB(ConvertibleTo<int>());
+}
+
+template <typename T> void templateFactoryInstantiationBeforeDefinition(T t) {
+  (void)absl::Nanoseconds(t);
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+}
+
+#define ONLY_WARN_INSIDE_MACRO_FACTORY                                         \
+  (void)absl::Nanoseconds(ConvertibleTo<int>())
+#define T_CALL_FACTORTY_INSIDE_MACRO (void)absl::Nanoseconds(T())
+
+template <typename T> void factoryTemplateAndMacro() {
+  (void)absl::Nanoseconds(T_OBJECT);
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  (void)absl::Nanoseconds(CONVERTIBLE_TMP);
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(CONVERTIBLE_TMP))
+  T_CALL_FACTORTY_INSIDE_MACRO;
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+}
+
+#define TEMPLATE_FACTORY_MACRO(factory)                                        \
+  template <typename T> void TemplateFactoryInMacro(T t) { (void)factory(t); }
+
+TEMPLATE_FACTORY_MACRO(absl::Nanoseconds)
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+
+void factoryInMacros() {
+  (void)absl::Nanoseconds(FUNCTION_MACRO(ConvertibleTo<int>()));
+  // CHECK-MESSAGES: [[@LINE-1]]:42: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(FUNCTION_MACRO(ConvertibleTo<int>())));
+  (void)absl::Nanoseconds(CONVERTIBLE_TMP);
+  // CHECK-MESSAGES: [[@LINE-1]]:27: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  // CHECK-FIXES: (void)absl::Nanoseconds(static_cast<int64_t>(CONVERTIBLE_TMP))
+  ONLY_WARN_INSIDE_MACRO_FACTORY;
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: implicit conversion to 'int64_t' is deprecated in this context; use an explicit cast instead
+  factoryTemplateAndMacro<ConvertibleTo<int>>();
+  TemplateFactoryInMacro(ConvertibleTo<int>());
+}
+
+// This is a reduced test-case for PR39949 and manifested in this check.
+namespace std {
+template <typename _Tp>
+_Tp declval();
+
+template <typename _Functor, typename... _ArgTypes>
+struct __res {
+  template <typename... _Args>
+  static decltype(declval<_Functor>()(_Args()...)) _S_test(int);
+
+  template <typename...>
+  static void _S_test(...);
+
+  typedef decltype(_S_test<_ArgTypes...>(0)) type;
+};
+
+template <typename>
+struct function;
+
+template <typename... _ArgTypes>
+struct function<void(_ArgTypes...)> {
+  template <typename _Functor,
+            typename = typename __res<_Functor, _ArgTypes...>::type>
+  function(_Functor) {}
+};
+} // namespace std
+
+typedef std::function<void(void)> F;
+
+F foo() {
+  return F([] {});
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,28 @@
+// RUN: %check_clang_tidy %s android-cloexec-accept %t
+
+struct sockaddr {};
+typedef int socklen_t;
+#define NULL 0
+
+extern "C" int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
+
+void f() {
+  accept(0, NULL, NULL);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer accept4() to accept() because accept4() allows SOCK_CLOEXEC [android-cloexec-accept]
+  // CHECK-FIXES: accept4(0, NULL, NULL, SOCK_CLOEXEC);
+}
+
+namespace i {
+int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
+void g() {
+  accept(0, NULL, NULL);
+}
+} // namespace i
+
+class C {
+public:
+  int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
+  void h() {
+    accept(0, NULL, NULL);
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept4.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept4.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept4.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-accept4.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,66 @@
+// RUN: %check_clang_tidy %s android-cloexec-accept4 %t
+
+typedef int socklen_t;
+struct sockaddr {};
+
+#define SOCK_NONBLOCK 1
+#define __O_CLOEXEC 3
+#define SOCK_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+#define NULL 0
+
+extern "C" int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
+
+void a() {
+  accept4(0, NULL, NULL, SOCK_NONBLOCK);
+  // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: 'accept4' should use SOCK_CLOEXEC where possible [android-cloexec-accept4]
+  // CHECK-FIXES: accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC);
+  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK));
+  // CHECK-MESSAGES: :[[@LINE-1]]:58: warning: 'accept4'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC));
+}
+
+void f() {
+  accept4(0, NULL, NULL, 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: 'accept4'
+  // CHECK-FIXES: accept4(0, NULL, NULL, 3 | SOCK_CLOEXEC);
+  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: 'accept4'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, 3 | SOCK_CLOEXEC));
+
+  int flag = SOCK_NONBLOCK;
+  accept4(0, NULL, NULL, flag);
+  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, flag));
+}
+
+namespace i {
+int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
+
+void d() {
+  accept4(0, NULL, NULL, SOCK_NONBLOCK);
+  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK));
+}
+
+} // namespace i
+
+void e() {
+  accept4(0, NULL, NULL, SOCK_CLOEXEC);
+  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_CLOEXEC));
+  accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC);
+  TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK | SOCK_CLOEXEC));
+}
+
+class G {
+public:
+  int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
+  void d() {
+    accept4(0, NULL, NULL, SOCK_NONBLOCK);
+    TEMP_FAILURE_RETRY(accept4(0, NULL, NULL, SOCK_NONBLOCK));
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-creat.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-creat.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-creat.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-creat.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,35 @@
+// RUN: %check_clang_tidy %s android-cloexec-creat %t
+
+typedef int mode_t;
+
+extern "C" int creat(const char *path, mode_t, ...);
+extern "C" int create(const char *path, mode_t, ...);
+
+void f() {
+  creat("filename", 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer open() to creat() because open() allows O_CLOEXEC [android-cloexec-creat]
+  // CHECK-FIXES: open ("filename", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0);
+  create("filename", 0);
+  // CHECK-MESSAGES-NOT: warning:
+  mode_t mode = 0755;
+  creat("filename", mode);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning:
+  // CHECK-FIXES: open ("filename", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode);
+}
+
+namespace i {
+int creat(const char *path, mode_t, ...);
+void g() {
+  creat("filename", 0);
+  // CHECK-MESSAGES-NOT: warning:
+}
+} // namespace i
+
+class C {
+public:
+  int creat(const char *path, mode_t, ...);
+  void h() {
+    creat("filename", 0);
+    // CHECK-MESSAGES-NOT: warning:
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-dup.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-dup.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-dup.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-dup.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,31 @@
+// RUN: %check_clang_tidy %s android-cloexec-dup %t
+
+extern "C" int dup(int oldfd);
+void f() {
+  dup(1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer fcntl() to dup() because fcntl() allows F_DUPFD_CLOEXEC [android-cloexec-dup]
+  // CHECK-FIXES: fcntl(1, F_DUPFD_CLOEXEC);
+  int oldfd = 0;
+  dup(oldfd);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer
+  // CHECK-FIXES: fcntl(oldfd, F_DUPFD_CLOEXEC);
+}
+
+namespace i {
+int dup(int oldfd);
+void g() {
+  dup(0);
+  int oldfd = 1;
+  dup(oldfd);
+}
+} // namespace i
+
+class C {
+public:
+  int dup(int oldfd);
+  void h() {
+    dup(0);
+    int oldfd = 1;
+    dup(oldfd);
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy %s android-cloexec-epoll-create %t
+
+extern "C" int epoll_create(int size);
+
+void f() {
+  epoll_create(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer epoll_create() to epoll_create1() because epoll_create1() allows EPOLL_CLOEXEC [android-cloexec-epoll-create]
+  // CHECK-FIXES: epoll_create1(EPOLL_CLOEXEC);
+}
+
+namespace i {
+int epoll_create(int size);
+void g() {
+  epoll_create(0);
+}
+} // namespace i
+
+class C {
+public:
+  int epoll_create(int size);
+  void h() {
+    epoll_create(0);
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create1.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create1.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create1.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-epoll-create1.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,59 @@
+// RUN: %check_clang_tidy %s android-cloexec-epoll-create1 %t
+
+#define __O_CLOEXEC 3
+#define EPOLL_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+
+extern "C" int epoll_create1(int flags);
+
+void a() {
+  epoll_create1(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'epoll_create1' should use EPOLL_CLOEXEC where possible [android-cloexec-epoll-create1]
+  // CHECK-FIXES: epoll_create1(EPOLL_CLOEXEC);
+  TEMP_FAILURE_RETRY(epoll_create1(0));
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'epoll_create1'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
+}
+
+void f() {
+  epoll_create1(3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'epoll_create1'
+  // CHECK-FIXES: epoll_create1(EPOLL_CLOEXEC);
+  TEMP_FAILURE_RETRY(epoll_create1(3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'epoll_create1'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
+
+  int flag = 0;
+  epoll_create1(EPOLL_CLOEXEC);
+  TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
+}
+
+namespace i {
+int epoll_create1(int flags);
+
+void d() {
+  epoll_create1(0);
+  TEMP_FAILURE_RETRY(epoll_create1(0));
+}
+
+} // namespace i
+
+void e() {
+  epoll_create1(EPOLL_CLOEXEC);
+  TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
+}
+
+class G {
+public:
+  int epoll_create1(int flags);
+  void d() {
+    epoll_create1(EPOLL_CLOEXEC);
+    TEMP_FAILURE_RETRY(epoll_create1(EPOLL_CLOEXEC));
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-fopen.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-fopen.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-fopen.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-fopen.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,57 @@
+// RUN: %check_clang_tidy %s android-cloexec-fopen %t
+
+#define FILE_OPEN_RO "r"
+
+typedef int FILE;
+
+extern "C" FILE *fopen(const char *filename, const char *mode, ...);
+extern "C" FILE *open(const char *filename, const char *mode, ...);
+
+void f() {
+  fopen("filename", "r");
+  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: use 'fopen' mode 'e' to set O_CLOEXEC [android-cloexec-fopen]
+  // CHECK-FIXES: fopen("filename", "re");
+
+  fopen("filename", FILE_OPEN_RO);
+  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: use 'fopen' mode 'e'
+  // CHECK-FIXES: fopen("filename", FILE_OPEN_RO "e");
+
+  fopen("filename", "er");
+  // CHECK-MESSAGES-NOT: warning:
+  fopen("filename", "re");
+  // CHECK-MESSAGES-NOT: warning:
+  fopen("filename", "e");
+  // CHECK-MESSAGES-NOT: warning:
+  open("filename", "e");
+  // CHECK-MESSAGES-NOT: warning:
+
+  char *str = "r";
+  fopen("filename", str);
+  // CHECK-MESSAGES-NOT: warning:
+  str = "re";
+  fopen("filename", str);
+  // CHECK-MESSAGES-NOT: warning:
+  char arr[2] = "r";
+  fopen("filename", arr);
+  // CHECK-MESSAGES-NOT: warning:
+  char arr2[3] = "re";
+  fopen("filename", arr2);
+  // CHECK-MESSAGES-NOT: warning:
+}
+
+namespace i {
+int *fopen(const char *filename, const char *mode, ...);
+void g() {
+  fopen("filename", "e");
+  // CHECK-MESSAGES-NOT: warning:
+}
+} // namespace i
+
+class C {
+public:
+  int *fopen(const char *filename, const char *mode, ...);
+  void h() {
+    fopen("filename", "e");
+    // CHECK-MESSAGES-NOT: warning:
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy %s android-cloexec-inotify-init %t
+
+extern "C" int inotify_init();
+
+void f() {
+  inotify_init();
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer inotify_init() to inotify_init1() because inotify_init1() allows IN_CLOEXEC [android-cloexec-inotify-init]
+  // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
+}
+
+namespace i {
+int inotify_init();
+void g() {
+  inotify_init();
+}
+} // namespace i
+
+class C {
+public:
+  int inotify_init();
+  void h() {
+    inotify_init();
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init1.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init1.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init1.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-inotify-init1.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,64 @@
+// RUN: %check_clang_tidy %s android-cloexec-inotify-init1 %t
+
+#define IN_NONBLOCK 1
+#define __O_CLOEXEC 3
+#define IN_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+
+extern "C" int inotify_init1(int flags);
+
+void a() {
+  inotify_init1(IN_NONBLOCK);
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: 'inotify_init1' should use IN_CLOEXEC where possible [android-cloexec-inotify-init1]
+  // CHECK-FIXES: inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
+  TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK));
+  // CHECK-MESSAGES: :[[@LINE-1]]:47: warning: 'inotify_init1'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
+}
+
+void f() {
+  inotify_init1(0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'inotify_init1'
+  // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
+  TEMP_FAILURE_RETRY(inotify_init1(0));
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'inotify_init1'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
+
+  int flag = 1;
+  inotify_init1(flag);
+  TEMP_FAILURE_RETRY(inotify_init1(flag));
+}
+
+namespace i {
+int inotify_init1(int flags);
+
+void d() {
+  inotify_init1(IN_NONBLOCK);
+  TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK));
+}
+
+} // namespace i
+
+void e() {
+  inotify_init1(IN_CLOEXEC);
+  TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
+  inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
+  TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
+}
+
+class G {
+public:
+  int inotify_init1(int flags);
+  void d() {
+    inotify_init1(IN_CLOEXEC);
+    TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
+    inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
+    TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-memfd-create.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-memfd-create.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-memfd-create.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-memfd-create.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,63 @@
+// RUN: %check_clang_tidy %s android-cloexec-memfd-create %t
+
+#define MFD_ALLOW_SEALING 1
+#define __O_CLOEXEC 3
+#define MFD_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+#define NULL 0
+
+extern "C" int memfd_create(const char *name, unsigned int flags);
+
+void a() {
+  memfd_create(NULL, MFD_ALLOW_SEALING);
+  // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: 'memfd_create' should use MFD_CLOEXEC where possible [android-cloexec-memfd-create]
+  // CHECK-FIXES: memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC)
+  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
+  // CHECK-MESSAGES: :[[@LINE-1]]:58: warning: 'memfd_create'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC))
+}
+
+void f() {
+  memfd_create(NULL, 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: 'memfd_create'
+  // CHECK-FIXES: memfd_create(NULL, 3 | MFD_CLOEXEC)
+  TEMP_FAILURE_RETRY(memfd_create(NULL, 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: 'memfd_create'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, 3 | MFD_CLOEXEC))
+
+  int flag = 3;
+  memfd_create(NULL, flag);
+  TEMP_FAILURE_RETRY(memfd_create(NULL, flag));
+}
+
+namespace i {
+int memfd_create(const char *name, unsigned int flags);
+
+void d() {
+  memfd_create(NULL, MFD_ALLOW_SEALING);
+  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
+}
+
+} // namespace i
+
+void e() {
+  memfd_create(NULL, MFD_CLOEXEC);
+  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_CLOEXEC));
+  memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC);
+  TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC));
+}
+
+class G {
+public:
+  int memfd_create(const char *name, unsigned int flags);
+  void d() {
+    memfd_create(NULL, MFD_ALLOW_SEALING);
+    TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-open.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-open.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-open.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-open.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,180 @@
+// RUN: %check_clang_tidy %s android-cloexec-open %t
+
+#define O_RDWR 1
+#define O_EXCL 2
+#define __O_CLOEXEC 3
+#define O_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+
+extern "C" int open(const char *fn, int flags, ...);
+extern "C" int open64(const char *fn, int flags, ...);
+extern "C" int openat(int dirfd, const char *pathname, int flags, ...);
+
+void a() {
+  open("filename", O_RDWR);
+  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: 'open' should use O_CLOEXEC where possible [android-cloexec-open]
+  // CHECK-FIXES: O_RDWR | O_CLOEXEC
+  TEMP_FAILURE_RETRY(open("filename", O_RDWR));
+  // CHECK-MESSAGES: :[[@LINE-1]]:45: warning: 'open' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_CLOEXEC
+  open("filename", O_RDWR | O_EXCL);
+  // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: 'open' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+  TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_EXCL));
+  // CHECK-MESSAGES: :[[@LINE-1]]:54: warning: 'open' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+}
+
+void b() {
+  open64("filename", O_RDWR);
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: 'open64' should use O_CLOEXEC where possible [android-cloexec-open]
+  // CHECK-FIXES: O_RDWR | O_CLOEXEC
+  TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
+  // CHECK-MESSAGES: :[[@LINE-1]]:47: warning: 'open64' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_CLOEXEC
+  open64("filename", O_RDWR | O_EXCL);
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'open64' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+  TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_EXCL));
+  // CHECK-MESSAGES: :[[@LINE-1]]:56: warning: 'open64' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+}
+
+void c() {
+  openat(0, "filename", O_RDWR);
+  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: 'openat' should use O_CLOEXEC where possible [android-cloexec-open]
+  // CHECK-FIXES: O_RDWR | O_CLOEXEC
+  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
+  // CHECK-MESSAGES: :[[@LINE-1]]:50: warning: 'openat' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_CLOEXEC
+  openat(0, "filename", O_RDWR | O_EXCL);
+  // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: 'openat' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_EXCL));
+  // CHECK-MESSAGES: :[[@LINE-1]]:59: warning: 'openat' should use O_CLOEXEC where
+  // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+}
+
+void f() {
+  open("filename", 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: 'open' should use O_CLOEXEC where possible [android-cloexec-open]
+  // CHECK-FIXES: 3 | O_CLOEXEC
+  TEMP_FAILURE_RETRY(open("filename", 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: 'open' should use O_CLOEXEC where
+  // CHECK-FIXES: 3 | O_CLOEXEC
+  open64("filename", 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: 'open64' should use O_CLOEXEC where possible [android-cloexec-open]
+  // CHECK-FIXES: 3 | O_CLOEXEC
+  TEMP_FAILURE_RETRY(open64("filename", 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: 'open64' should use O_CLOEXEC where
+  // CHECK-FIXES: 3 | O_CLOEXEC
+  openat(0, "filename", 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: 'openat' should use O_CLOEXEC where possible [android-cloexec-open]
+  // CHECK-FIXES: 3 | O_CLOEXEC
+  TEMP_FAILURE_RETRY(openat(0, "filename", 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:45: warning: 'openat' should use O_CLOEXEC where
+  // CHECK-FIXES: 3 | O_CLOEXEC
+
+  int flag = 3;
+  open("filename", flag);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open("filename", flag));
+  // CHECK-MESSAGES-NOT: warning:
+  open64("filename", flag);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open64("filename", flag));
+  // CHECK-MESSAGES-NOT: warning:
+  openat(0, "filename", flag);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(openat(0, "filename", flag));
+  // CHECK-MESSAGES-NOT: warning:
+}
+
+namespace i {
+int open(const char *pathname, int flags, ...);
+int open64(const char *pathname, int flags, ...);
+int openat(int dirfd, const char *pathname, int flags, ...);
+
+void d() {
+  open("filename", O_RDWR);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open("filename", O_RDWR));
+  // CHECK-MESSAGES-NOT: warning:
+  open64("filename", O_RDWR);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
+  // CHECK-MESSAGES-NOT: warning:
+  openat(0, "filename", O_RDWR);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
+  // CHECK-MESSAGES-NOT: warning:
+}
+
+} // namespace i
+
+void e() {
+  open("filename", O_CLOEXEC);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open("filename", O_CLOEXEC));
+  // CHECK-MESSAGES-NOT: warning:
+  open("filename", O_RDWR | O_CLOEXEC);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_CLOEXEC));
+  // CHECK-MESSAGES-NOT: warning:
+  open("filename", O_RDWR | O_CLOEXEC | O_EXCL);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_CLOEXEC | O_EXCL));
+  // CHECK-MESSAGES-NOT: warning:
+  open64("filename", O_CLOEXEC);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open64("filename", O_CLOEXEC));
+  // CHECK-MESSAGES-NOT: warning:
+  open64("filename", O_RDWR | O_CLOEXEC);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_CLOEXEC));
+  // CHECK-MESSAGES-NOT: warning:
+  open64("filename", O_RDWR | O_CLOEXEC | O_EXCL);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_CLOEXEC | O_EXCL));
+  // CHECK-MESSAGES-NOT: warning:
+  openat(0, "filename", O_CLOEXEC);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(openat(0, "filename", O_CLOEXEC));
+  // CHECK-MESSAGES-NOT: warning:
+  openat(0, "filename", O_RDWR | O_CLOEXEC);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_CLOEXEC));
+  // CHECK-MESSAGES-NOT: warning:
+  openat(0, "filename", O_RDWR | O_CLOEXEC | O_EXCL);
+  // CHECK-MESSAGES-NOT: warning:
+  TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_CLOEXEC | O_EXCL));
+  // CHECK-MESSAGES-NOT: warning:
+}
+
+class G {
+public:
+  int open(const char *pathname, int flags, ...);
+  int open64(const char *pathname, int flags, ...);
+  int openat(int dirfd, const char *pathname, int flags, ...);
+
+  void h() {
+    open("filename", O_RDWR);
+    // CHECK-MESSAGES-NOT: warning:
+    TEMP_FAILURE_RETRY(open("filename", O_RDWR));
+    // CHECK-MESSAGES-NOT: warning:
+    open64("filename", O_RDWR);
+    // CHECK-MESSAGES-NOT: warning:
+    TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
+    // CHECK-MESSAGES-NOT: warning:
+    openat(0, "filename", O_RDWR);
+    // CHECK-MESSAGES-NOT: warning:
+    TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
+    // CHECK-MESSAGES-NOT: warning:
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,27 @@
+// RUN: %check_clang_tidy %s android-cloexec-pipe %t
+
+extern "C" int pipe(int pipefd[2]);
+
+void warning() {
+  int pipefd[2];
+  pipe(pipefd);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer pipe2() with O_CLOEXEC to avoid leaking file descriptors to child processes [android-cloexec-pipe]
+  // CHECK-FIXES: pipe2(pipefd, O_CLOEXEC);
+}
+
+namespace i {
+int pipe(int pipefd[2]);
+void noWarningInNamespace() {
+  int pipefd[2];
+  pipe(pipefd);
+}
+} // namespace i
+
+class C {
+public:
+  int pipe(int pipefd[2]);
+  void noWarningForMemberFunction() {
+    int pipefd[2];
+    pipe(pipefd);
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe2.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe2.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe2.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-pipe2.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,68 @@
+// RUN: %check_clang_tidy %s android-cloexec-pipe2 %t
+
+#define O_NONBLOCK 1
+#define __O_CLOEXEC 3
+#define O_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+#define NULL 0
+
+extern "C" int pipe2(int pipefd[2], int flags);
+
+void warning() {
+  int pipefd[2];
+  pipe2(pipefd, O_NONBLOCK);
+  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: 'pipe2'
+  // CHECK-FIXES: pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
+  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: 'pipe2'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK | O_CLOEXEC));
+}
+
+void warningInMacroArugment() {
+  int pipefd[2];
+  pipe2(pipefd, 3);
+  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: 'pipe2'
+  // CHECK-FIXES: pipe2(pipefd, 3 | O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, 3));
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'pipe2'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(pipe2(pipefd, 3 | O_CLOEXEC));
+
+  int flag = O_NONBLOCK;
+  pipe2(pipefd, flag);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, flag));
+}
+
+namespace i {
+int pipe2(int pipefd[2], int flags);
+
+void noWarning() {
+  int pipefd[2];
+  pipe2(pipefd, O_NONBLOCK);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
+}
+
+} // namespace i
+
+void noWarning() {
+  int pipefd[2];
+  pipe2(pipefd, O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_CLOEXEC));
+  pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);
+  TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK | O_CLOEXEC));
+}
+
+class G {
+public:
+  int pipe2(int pipefd[2], int flags);
+  void noWarning() {
+    int pipefd[2];
+    pipe2(pipefd, O_NONBLOCK);
+    TEMP_FAILURE_RETRY(pipe2(pipefd, O_NONBLOCK));
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-socket.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-socket.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-socket.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-cloexec-socket.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,75 @@
+// RUN: %check_clang_tidy %s android-cloexec-socket %t
+
+#define SOCK_STREAM 1
+#define SOCK_DGRAM 2
+#define __O_CLOEXEC 3
+#define SOCK_CLOEXEC __O_CLOEXEC
+#define TEMP_FAILURE_RETRY(exp) \
+  ({                            \
+    int _rc;                    \
+    do {                        \
+      _rc = (exp);              \
+    } while (_rc == -1);        \
+  })
+
+extern "C" int socket(int domain, int type, int protocol);
+
+void a() {
+  socket(0, SOCK_STREAM, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: 'socket' should use SOCK_CLOEXEC where possible [android-cloexec-socket]
+  // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0)
+  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
+  // CHECK-MESSAGES: :[[@LINE-1]]:43: warning: 'socket'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0))
+  socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'socket'
+  // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0)
+  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
+  // CHECK-MESSAGES: :[[@LINE-1]]:56: warning: 'socket'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0))
+}
+
+void f() {
+  socket(0, 3, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: 'socket'
+  // CHECK-FIXES: socket(0, 3 | SOCK_CLOEXEC, 0)
+  TEMP_FAILURE_RETRY(socket(0, 3, 0));
+  // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: 'socket'
+  // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, 3 | SOCK_CLOEXEC, 0))
+
+  int flag = 3;
+  socket(0, flag, 0);
+  TEMP_FAILURE_RETRY(socket(0, flag, 0));
+}
+
+namespace i {
+int socket(int domain, int type, int protocol);
+
+void d() {
+  socket(0, SOCK_STREAM, 0);
+  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
+  socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
+  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
+}
+
+} // namespace i
+
+void e() {
+  socket(0, SOCK_CLOEXEC, 0);
+  TEMP_FAILURE_RETRY(socket(0, SOCK_CLOEXEC, 0));
+  socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0);
+  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0));
+  socket(0, SOCK_STREAM | SOCK_CLOEXEC | SOCK_DGRAM, 0);
+  TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC | SOCK_DGRAM, 0));
+}
+
+class G {
+public:
+  int socket(int domain, int type, int protocol);
+  void d() {
+    socket(0, SOCK_STREAM, 0);
+    TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
+    socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
+    TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
+  }
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/android-comparison-in-temp-failure-retry.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/android-comparison-in-temp-failure-retry.c?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/android-comparison-in-temp-failure-retry.c (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/android-comparison-in-temp-failure-retry.c Fri Oct 11 05:05:42 2019
@@ -0,0 +1,148 @@
+// RUN: %check_clang_tidy %s android-comparison-in-temp-failure-retry %t
+
+#define TEMP_FAILURE_RETRY(x)                                                  \
+  ({                                                                           \
+    typeof(x) __z;                                                             \
+    do                                                                         \
+      __z = (x);                                                               \
+    while (__z == -1);                                                         \
+    __z;                                                                       \
+  })
+
+int foo();
+int bar(int a);
+
+void test() {
+  int i;
+  TEMP_FAILURE_RETRY((i = foo()));
+  TEMP_FAILURE_RETRY(foo());
+  TEMP_FAILURE_RETRY((foo()));
+
+  TEMP_FAILURE_RETRY(foo() == 1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: top-level comparison in TEMP_FAILURE_RETRY [android-comparison-in-temp-failure-retry]
+  TEMP_FAILURE_RETRY((foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: top-level comparison in TEMP_FAILURE_RETRY
+  TEMP_FAILURE_RETRY((int)(foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+  TEMP_FAILURE_RETRY(bar(foo() == 1));
+  TEMP_FAILURE_RETRY((bar(foo() == 1)));
+  TEMP_FAILURE_RETRY((bar(foo() == 1)) == 1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: top-level comparison in TEMP_FAILURE_RETRY
+  TEMP_FAILURE_RETRY(((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:41: warning: top-level comparison in TEMP_FAILURE_RETRY
+  TEMP_FAILURE_RETRY((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+#define INDIRECT TEMP_FAILURE_RETRY
+  INDIRECT(foo());
+  INDIRECT((foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: top-level comparison in TEMP_FAILURE_RETRY
+  INDIRECT(bar(foo() == 1));
+  INDIRECT((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:36: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+#define TFR(x) TEMP_FAILURE_RETRY(x)
+  TFR(foo());
+  TFR((foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: top-level comparison in TEMP_FAILURE_RETRY
+  TFR(bar(foo() == 1));
+  TFR((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+#define ADD_TFR(x) (1 + TEMP_FAILURE_RETRY(x) + 1)
+  ADD_TFR(foo());
+  ADD_TFR(foo() == 1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+  ADD_TFR(bar(foo() == 1));
+  ADD_TFR((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+#define ADDP_TFR(x) (1 + TEMP_FAILURE_RETRY((x)) + 1)
+  ADDP_TFR(foo());
+  ADDP_TFR((foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+  ADDP_TFR(bar(foo() == 1));
+  ADDP_TFR((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:36: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+#define MACRO TEMP_FAILURE_RETRY(foo() == 1)
+  MACRO;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+  // Be sure that being a macro arg doesn't mess with this.
+#define ID(x) (x)
+  ID(ADDP_TFR(bar(foo() == 1)));
+  ID(ADDP_TFR(bar(foo() == 1) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: top-level comparison in TEMP_FAILURE_RETRY
+  ID(MACRO);
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: top-level comparison in TEMP_FAILURE_RETRY
+
+#define CMP(x) x == 1
+  TEMP_FAILURE_RETRY(CMP(foo()));
+  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: top-level comparison in TEMP_FAILURE_RETRY
+}
+
+// Be sure that it works inside of things like loops, if statements, etc.
+void control_flow() {
+  do {
+    if (TEMP_FAILURE_RETRY(foo())) {
+    }
+
+    if (TEMP_FAILURE_RETRY(foo() == 1)) {
+      // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
+    }
+
+    if (TEMP_FAILURE_RETRY(bar(foo() == 1))) {
+    }
+
+    if (TEMP_FAILURE_RETRY(bar(foo() == 1) == 1)) {
+      // CHECK-MESSAGES: :[[@LINE-1]]:44: warning: top-level comparison in TEMP_FAILURE_RETRY
+    }
+  } while (TEMP_FAILURE_RETRY(foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: top-level comparison in TEMP_FAILURE_RETRY
+}
+
+void with_nondependent_variable_type() {
+#undef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(x)                                                  \
+  ({                                                                           \
+    long int __z;                                                              \
+    do                                                                         \
+      __z = (x);                                                               \
+    while (__z == -1);                                                         \
+    __z;                                                                       \
+  })
+
+  TEMP_FAILURE_RETRY((foo()));
+  TEMP_FAILURE_RETRY((int)(foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
+  TEMP_FAILURE_RETRY((bar(foo() == 1)));
+  TEMP_FAILURE_RETRY((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: top-level comparison in TEMP_FAILURE_RETRY
+}
+
+// I can't find a case where TEMP_FAILURE_RETRY is implemented like this, but if
+// we can cheaply support it, I don't see why not.
+void obscured_temp_failure_retry() {
+#undef TEMP_FAILURE_RETRY
+#define IMPL(x)                                                                \
+  ({                                                                           \
+    typeof(x) __z;                                                             \
+    do                                                                         \
+      __z = (x);                                                               \
+    while (__z == -1);                                                         \
+    __z;                                                                       \
+  })
+
+#define IMPL2(x) IMPL(x)
+#define TEMP_FAILURE_RETRY(x) IMPL2(x)
+  TEMP_FAILURE_RETRY((foo()));
+  TEMP_FAILURE_RETRY((int)(foo() == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: top-level comparison in TEMP_FAILURE_RETRY
+  TEMP_FAILURE_RETRY((bar(foo() == 1)));
+  TEMP_FAILURE_RETRY((int)((bar(foo() == 1)) == 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:46: warning: top-level comparison in TEMP_FAILURE_RETRY
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/boost-use-to-string.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/boost-use-to-string.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/boost-use-to-string.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/boost-use-to-string.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,169 @@
+// RUN: %check_clang_tidy %s boost-use-to-string %t
+
+namespace std {
+
+template <typename T>
+class basic_string {};
+
+using string = basic_string<char>;
+using wstring = basic_string<wchar_t>;
+}
+
+namespace boost {
+template <typename T, typename V>
+T lexical_cast(const V &) {
+  return T();
+};
+}
+
+struct my_weird_type {};
+
+std::string fun(const std::string &) {}
+
+void test_to_string1() {
+
+  auto xa = boost::lexical_cast<std::string>(5);
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string instead of boost::lexical_cast<std::string> [boost-use-to-string]
+  // CHECK-FIXES: auto xa = std::to_string(5);
+
+  auto z = boost::lexical_cast<std::string>(42LL);
+  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: use std::to_string
+  // CHECK-FIXES: auto z = std::to_string(42LL);
+
+  // this should not trigger
+  fun(boost::lexical_cast<std::string>(42.0));
+  auto non = boost::lexical_cast<my_weird_type>(42);
+  boost::lexical_cast<int>("12");
+}
+
+void test_to_string2() {
+  int a;
+  long b;
+  long long c;
+  unsigned d;
+  unsigned long e;
+  unsigned long long f;
+  float g;
+  double h;
+  long double i;
+  bool j;
+
+  fun(boost::lexical_cast<std::string>(a));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
+  // CHECK-FIXES: fun(std::to_string(a));
+  fun(boost::lexical_cast<std::string>(b));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
+  // CHECK-FIXES: fun(std::to_string(b));
+  fun(boost::lexical_cast<std::string>(c));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
+  // CHECK-FIXES: fun(std::to_string(c));
+  fun(boost::lexical_cast<std::string>(d));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
+  // CHECK-FIXES: fun(std::to_string(d));
+  fun(boost::lexical_cast<std::string>(e));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
+  // CHECK-FIXES: fun(std::to_string(e));
+  fun(boost::lexical_cast<std::string>(f));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_string
+  // CHECK-FIXES: fun(std::to_string(f));
+
+  // No change for floating numbers.
+  fun(boost::lexical_cast<std::string>(g));
+  fun(boost::lexical_cast<std::string>(h));
+  fun(boost::lexical_cast<std::string>(i));
+  // And bool.
+  fun(boost::lexical_cast<std::string>(j));
+}
+
+std::string fun(const std::wstring &) {}
+
+void test_to_wstring() {
+  int a;
+  long b;
+  long long c;
+  unsigned d;
+  unsigned long e;
+  unsigned long long f;
+  float g;
+  double h;
+  long double i;
+  bool j;
+
+  fun(boost::lexical_cast<std::wstring>(a));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring instead of boost::lexical_cast<std::wstring> [boost-use-to-string]
+  // CHECK-FIXES: fun(std::to_wstring(a));
+  fun(boost::lexical_cast<std::wstring>(b));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
+  // CHECK-FIXES: fun(std::to_wstring(b));
+  fun(boost::lexical_cast<std::wstring>(c));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
+  // CHECK-FIXES: fun(std::to_wstring(c));
+  fun(boost::lexical_cast<std::wstring>(d));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
+  // CHECK-FIXES: fun(std::to_wstring(d));
+  fun(boost::lexical_cast<std::wstring>(e));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
+  // CHECK-FIXES: fun(std::to_wstring(e));
+  fun(boost::lexical_cast<std::wstring>(f));
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use std::to_wstring
+  // CHECK-FIXES: fun(std::to_wstring(f));
+
+  // No change for floating numbers
+  fun(boost::lexical_cast<std::wstring>(g));
+  fun(boost::lexical_cast<std::wstring>(h));
+  fun(boost::lexical_cast<std::wstring>(i));
+  // and bool.
+  fun(boost::lexical_cast<std::wstring>(j));
+}
+
+const auto glob = boost::lexical_cast<std::string>(42);
+// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: use std::to_string
+// CHECK-FIXES: const auto glob = std::to_string(42);
+
+template <typename T>
+void string_as_T(T t = T()) {
+  boost::lexical_cast<std::string>(42);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use std::to_string
+  // CHECK-FIXES: std::to_string(42);
+
+  boost::lexical_cast<T>(42);
+  string_as_T(boost::lexical_cast<T>(42));
+  auto p = boost::lexical_cast<T>(42);
+  auto p2 = (T)boost::lexical_cast<T>(42);
+  auto p3 = static_cast<T>(boost::lexical_cast<T>(42));
+}
+
+#define my_to_string boost::lexical_cast<std::string>
+
+void no_fixup_inside_macro() {
+  my_to_string(12);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use std::to_string
+}
+
+void no_warnings() {
+  fun(boost::lexical_cast<std::string>("abc"));
+  fun(boost::lexical_cast<std::wstring>("abc"));
+  fun(boost::lexical_cast<std::string>(my_weird_type{}));
+  string_as_T<int>();
+  string_as_T<std::string>();
+}
+
+struct Fields {
+  int integer;
+  float floating;
+  Fields* wierd;
+  const int &getConstInteger() const {return integer;}
+};
+
+void testFields() {
+  Fields fields;
+  auto s1 = boost::lexical_cast<std::string>(fields.integer);
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string
+  // CHECK-FIXES: auto s1 = std::to_string(fields.integer);
+
+  auto s2 = boost::lexical_cast<std::string>(fields.floating);
+  auto s3 = boost::lexical_cast<std::string>(fields.wierd);
+  auto s4 = boost::lexical_cast<std::string>(fields.getConstInteger());
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string
+  // CHECK-FIXES: auto s4 = std::to_string(fields.getConstInteger());
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-gmock.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-gmock.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-gmock.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-gmock.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,130 @@
+// RUN: %check_clang_tidy %s bugprone-argument-comment %t
+
+namespace testing {
+namespace internal {
+
+template <typename F>
+struct Function;
+
+template <typename R>
+struct Function<R()> {
+  typedef R Result;
+};
+
+template <typename R, typename A1>
+struct Function<R(A1)>
+    : Function<R()> {
+  typedef A1 Argument1;
+};
+
+template <typename R, typename A1, typename A2>
+struct Function<R(A1, A2)>
+    : Function<R(A1)> {
+  typedef A2 Argument2;
+};
+
+} // namespace internal
+
+template <typename F>
+class MockSpec {
+ public:
+  void f();
+};
+
+template <typename T>
+class Matcher {
+ public:
+  explicit Matcher();
+  Matcher(T value);
+};
+
+} // namespace testing
+
+#define GMOCK_RESULT_(tn, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Result
+#define GMOCK_ARG_(tn, N, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
+#define GMOCK_MATCHER_(tn, N, ...) \
+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
+#define GMOCK_METHOD2_(tn, constness, ct, Method, ...)            \
+  GMOCK_RESULT_(tn, __VA_ARGS__)                                  \
+  ct Method(                                                      \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                    \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness;         \
+  ::testing::MockSpec<__VA_ARGS__>                                \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness
+#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
+#define GMOCK_EXPECT_CALL_IMPL_(obj, call) \
+    ((obj).gmock_##call).f()
+#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
+
+class Base {
+ public:
+  virtual void Method(int param_one_base, int param_two_base);
+};
+class Derived : public Base {
+ public:
+  virtual void Method(int param_one, int param_two);
+  virtual void Method2(int p_one, int p_two) const;
+};
+class MockDerived : public Derived {
+ public:
+  MOCK_METHOD2(Method, void(int a, int b));
+  MOCK_CONST_METHOD2(Method2, void(int c, int d));
+};
+
+class MockStandalone {
+ public:
+  MOCK_METHOD2(Method, void(int aaa, int bbb));
+};
+
+void test_gmock_expectations() {
+  MockDerived m;
+  EXPECT_CALL(m, Method(/*param_one=*/1, /*param_tw=*/2));
+// CHECK-NOTES: [[@LINE-1]]:42: warning: argument name 'param_tw' in comment does not match parameter name 'param_two'
+// CHECK-NOTES: [[@LINE-18]]:42: note: 'param_two' declared here
+// CHECK-NOTES: [[@LINE-14]]:3: note: actual callee ('gmock_Method') is declared here
+// CHECK-NOTES: [[@LINE-32]]:30: note: expanded from macro 'MOCK_METHOD2'
+// CHECK-NOTES: [[@LINE-35]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: note: expanded from here
+// CHECK-FIXES:   EXPECT_CALL(m, Method(/*param_one=*/1, /*param_two=*/2));
+  EXPECT_CALL(m, Method2(/*p_on=*/3, /*p_two=*/4));
+// CHECK-NOTES: [[@LINE-1]]:26: warning: argument name 'p_on' in comment does not match parameter name 'p_one'
+// CHECK-NOTES: [[@LINE-25]]:28: note: 'p_one' declared here
+// CHECK-NOTES: [[@LINE-21]]:3: note: actual callee ('gmock_Method2') is declared here
+// CHECK-NOTES: [[@LINE-39]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
+// CHECK-NOTES: [[@LINE-43]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: note: expanded from here
+// CHECK-FIXES:   EXPECT_CALL(m, Method2(/*p_one=*/3, /*p_two=*/4));
+
+  #define PARAM1 11
+  #define PARAM2 22
+  EXPECT_CALL(m, Method2(/*p_on1=*/PARAM1, /*p_tw2=*/PARAM2));
+// CHECK-NOTES: [[@LINE-1]]:26: warning: argument name 'p_on1' in comment does not match parameter name 'p_one'
+// CHECK-NOTES: [[@LINE-36]]:28: note: 'p_one' declared here
+// CHECK-NOTES: [[@LINE-32]]:3: note: actual callee ('gmock_Method2') is declared here
+// CHECK-NOTES: [[@LINE-50]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
+// CHECK-NOTES: [[@LINE-54]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: note: expanded from here
+// CHECK-NOTES: [[@LINE-7]]:44: warning: argument name 'p_tw2' in comment does not match parameter name 'p_two'
+// CHECK-NOTES: [[@LINE-42]]:39: note: 'p_two' declared here
+// CHECK-NOTES: [[@LINE-38]]:3: note: actual callee ('gmock_Method2') is declared here
+// CHECK-NOTES: [[@LINE-56]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
+// CHECK-NOTES: [[@LINE-60]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: note: expanded from here
+// CHECK-FIXES:   EXPECT_CALL(m, Method2(/*p_one=*/PARAM1, /*p_two=*/PARAM2));
+
+  MockStandalone m2;
+  EXPECT_CALL(m2, Method(/*aaa=*/5, /*bbc=*/6));
+}
+
+void test_gmock_direct_calls() {
+  MockDerived m;
+  m.Method(/*param_one=*/1, /*param_tw=*/2);
+// CHECK-NOTES: [[@LINE-1]]:29: warning: argument name 'param_tw' in comment does not match parameter name 'param_two'
+// CHECK-NOTES: [[@LINE-58]]:42: note: 'param_two' declared here
+// CHECK-NOTES: [[@LINE-54]]:16: note: actual callee ('Method') is declared here
+// CHECK-FIXES:   m.Method(/*param_one=*/1, /*param_two=*/2);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-ignore-single-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-ignore-single-argument.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-ignore-single-argument.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-ignore-single-argument.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,105 @@
+// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
+// RUN:   -config="{CheckOptions: [ \
+// RUN:     {key: bugprone-argument-comment.IgnoreSingleArgument, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
+
+struct A {
+  void foo(bool abc);
+  void foo(bool abc, bool cde);
+  void foo(const char *, bool abc);
+  void foo(int iabc);
+  void foo(float fabc);
+  void foo(double dabc);
+  void foo(const char *strabc);
+  void fooW(const wchar_t *wstrabc);
+  void fooPtr(A *ptrabc);
+  void foo(char chabc);
+};
+
+#define FOO 1
+
+void g(int a);
+void h(double b);
+void i(const char *c);
+
+double operator"" _km(long double);
+
+void test() {
+  A a;
+
+  a.foo(true);
+
+  a.foo(false);
+
+  a.foo(true, false);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/true, /*cde=*/false);
+
+  a.foo(false, true);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:16: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
+
+  a.foo(/*abc=*/false, true);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
+
+  a.foo(false, /*cde=*/true);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
+
+  bool val1 = true;
+  bool val2 = false;
+  a.foo(val1, val2);
+
+  a.foo("", true);
+  // CHECK-MESSAGES: [[@LINE-1]]:13: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo("", /*abc=*/true);
+
+  a.foo(0);
+
+  a.foo(1.0f);
+
+  a.foo(1.0);
+
+  int val3 = 10;
+  a.foo(val3);
+
+  float val4 = 10.0;
+  a.foo(val4);
+
+  double val5 = 10.0;
+  a.foo(val5);
+
+  a.foo("Hello World");
+
+  a.fooW(L"Hello World");
+
+  a.fooPtr(nullptr);
+
+  a.foo(402.0_km);
+
+  a.foo('A');
+
+  g(FOO);
+
+  h(1.0f);
+
+  i(__FILE__);
+
+  g((1));
+}
+
+void f(bool _with_underscores_);
+void ignores_underscores() {
+  f(false);
+
+  f(true);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-literals.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-literals.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-literals.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-literals.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,185 @@
+// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
+// RUN:   -config="{CheckOptions: [ \
+// RUN:     {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
+// RUN:     {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
+
+struct A {
+  void foo(bool abc);
+  void foo(bool abc, bool cde);
+  void foo(const char *, bool abc);
+  void foo(int iabc);
+  void foo(float fabc);
+  void foo(double dabc);
+  void foo(const char *strabc);
+  void fooW(const wchar_t *wstrabc);
+  void fooPtr(A *ptrabc);
+  void foo(char chabc);
+};
+
+#define FOO 1
+#define X(x) (x)
+
+void g(int a);
+void h(double b);
+void i(const char *c);
+void j(int a, int b, int c);
+
+double operator"" _km(long double);
+
+void test() {
+  A a;
+
+  a.foo(true);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/true);
+
+  a.foo(false);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false);
+
+  a.foo(true, false);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:15: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/true, /*cde=*/false);
+
+  a.foo(false, true);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:16: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
+
+  a.foo(/*abc=*/false, true);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: argument comment missing for literal argument 'cde' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
+
+  a.foo(false, /*cde=*/true);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*abc=*/false, /*cde=*/true);
+
+  bool val1 = true;
+  bool val2 = false;
+  a.foo(val1, val2);
+
+  a.foo("", true);
+  // CHECK-MESSAGES: [[@LINE-1]]:13: warning: argument comment missing for literal argument 'abc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo("", /*abc=*/true);
+
+  a.foo(0);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'iabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*iabc=*/0);
+
+  a.foo(1.0f);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'fabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*fabc=*/1.0f);
+
+  a.foo(-1.0f);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'fabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*fabc=*/-1.0f);
+
+  a.foo(1.0);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*dabc=*/1.0);
+
+  a.foo(-1.0);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*dabc=*/-1.0);
+
+  int val3 = 10;
+  a.foo(val3);
+  a.foo(-val3);
+
+  float val4 = 10.0;
+  a.foo(val4);
+  a.foo(-val4);
+
+  double val5 = 10.0;
+  a.foo(val5);
+  a.foo(-val5);
+
+  a.foo("Hello World");
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'strabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*strabc=*/"Hello World");
+  //
+  a.fooW(L"Hello World");
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: argument comment missing for literal argument 'wstrabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.fooW(/*wstrabc=*/L"Hello World");
+
+  a.fooPtr(nullptr);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: argument comment missing for literal argument 'ptrabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.fooPtr(/*ptrabc=*/nullptr);
+
+  a.foo(402.0_km);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*dabc=*/402.0_km);
+
+  a.foo(-402.0_km);
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'dabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*dabc=*/-402.0_km);
+
+  a.foo('A');
+  // CHECK-MESSAGES: [[@LINE-1]]:9: warning: argument comment missing for literal argument 'chabc' [bugprone-argument-comment]
+  // CHECK-FIXES: a.foo(/*chabc=*/'A');
+
+  g(FOO);
+  g(-FOO);
+  h(1.0f);
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
+  // CHECK-FIXES: h(/*b=*/1.0f);
+  h(-1.0f);
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
+  // CHECK-FIXES: h(/*b=*/-1.0f);
+  i(__FILE__);
+
+  j(1, X(1), X(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'a' [bugprone-argument-comment]
+  // CHECK-FIXES: j(/*a=*/1, X(1), X(1));
+  j(/*a=*/1, X(1), X(1));
+
+  j(X(1), 1, X(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
+  // CHECK-FIXES: j(X(1), /*b=*/1, X(1));
+  j(X(1), /*b=*/1, X(1));
+
+  j(X(1), X(1), 1);
+  // CHECK-MESSAGES: [[@LINE-1]]:17: warning: argument comment missing for literal argument 'c' [bugprone-argument-comment]
+  // CHECK-FIXES: j(X(1), X(1), /*c=*/1);
+  j(X(1), X(1), /*c=*/1);
+
+  j(X(1), 1, 1);
+  // CHECK-MESSAGES: [[@LINE-1]]:11: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:14: warning: argument comment missing for literal argument 'c' [bugprone-argument-comment]
+  // CHECK-FIXES: j(X(1), /*b=*/1, /*c=*/1);
+  j(X(1), /*b=*/1, /*c=*/1);
+
+  j(1, X(1), 1);
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'a' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:14: warning: argument comment missing for literal argument 'c' [bugprone-argument-comment]
+  // CHECK-FIXES: j(/*a=*/1, X(1), /*c=*/1);
+  j(/*a=*/1, X(1), /*c=*/1);
+
+  j(1, 1, X(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument 'a' [bugprone-argument-comment]
+  // CHECK-MESSAGES: [[@LINE-2]]:8: warning: argument comment missing for literal argument 'b' [bugprone-argument-comment]
+  // CHECK-FIXES: j(/*a=*/1, /*b=*/1, X(1));
+  j(/*a=*/1, /*b=*/1, X(1));
+
+  // FIXME Would like the below to add argument comments.
+  g((1));
+  // FIXME But we should not add argument comments here.
+  g(_Generic(0, int : 0));
+}
+
+void f(bool _with_underscores_);
+void ignores_underscores() {
+  f(false);
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument '_with_underscores_' [bugprone-argument-comment]
+  // CHECK-FIXES: f(/*_with_underscores_=*/false);
+
+  f(true);
+  // CHECK-MESSAGES: [[@LINE-1]]:5: warning: argument comment missing for literal argument
+  // CHECK-FIXES: f(/*_with_underscores_=*/true);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-strict.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-strict.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-strict.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment-strict.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
+// RUN:   -config="{CheckOptions: [{key: StrictMode, value: 1}]}" --
+
+void f(int _with_underscores_);
+void g(int x_);
+void ignores_underscores() {
+  f(/*With_Underscores=*/0);
+// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'With_Underscores' in comment does not match parameter name '_with_underscores_'
+// CHECK-NOTES: [[@LINE-5]]:12: note: '_with_underscores_' declared here
+// CHECK-FIXES: f(/*_with_underscores_=*/0);
+
+  f(/*with_underscores=*/1);
+// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'with_underscores' in comment does not match parameter name '_with_underscores_'
+// CHECK-NOTES: [[@LINE-10]]:12: note: '_with_underscores_' declared here
+// CHECK-FIXES: f(/*_with_underscores_=*/1);
+  f(/*_With_Underscores_=*/2);
+// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name '_With_Underscores_' in comment does not match parameter name '_with_underscores_'
+// CHECK-NOTES: [[@LINE-14]]:12: note: '_with_underscores_' declared here
+// CHECK-FIXES: f(/*_with_underscores_=*/2);
+  g(/*X=*/3);
+// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'X' in comment does not match parameter name 'x_'
+// CHECK-NOTES: [[@LINE-17]]:12: note: 'x_' declared here
+// CHECK-FIXES: g(/*x_=*/3);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-argument-comment.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,117 @@
+// RUN: %check_clang_tidy %s bugprone-argument-comment %t
+
+// FIXME: clang-tidy should provide a -verify mode to make writing these checks
+// easier and more accurate.
+
+void ffff(int xxxx, int yyyy);
+
+void f(int x, int y);
+void g() {
+  // CHECK-NOTES: [[@LINE+4]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
+  // CHECK-NOTES: [[@LINE-3]]:12: note: 'x' declared here
+  // CHECK-NOTES: [[@LINE+2]]:14: warning: argument name 'z' in comment does not match parameter name 'y'
+  // CHECK-NOTES: [[@LINE-5]]:19: note: 'y' declared here
+  f(/*y=*/0, /*z=*/0);
+  // CHECK-FIXES: {{^}}  f(/*y=*/0, /*z=*/0);
+
+  f(/*x=*/1, /*y=*/1);
+
+  ffff(0 /*aaaa=*/, /*bbbb*/ 0); // Unsupported formats.
+}
+
+struct C {
+  C(int x, int y);
+};
+C c(/*x=*/0, /*y=*/0);
+
+struct Closure {};
+
+template <typename T1, typename T2>
+Closure *NewCallback(void (*f)(T1, T2), T1 arg1, T2 arg2) { return nullptr; }
+
+template <typename T1, typename T2>
+Closure *NewPermanentCallback(void (*f)(T1, T2), T1 arg1, T2 arg2) { return nullptr; }
+
+void h() {
+  (void)NewCallback(&ffff, /*xxxx=*/11, /*yyyy=*/22);
+  (void)NewPermanentCallback(&ffff, /*xxxx=*/11, /*yyyy=*/22);
+}
+
+template<typename... Args>
+void variadic(Args&&... args);
+
+template<typename... Args>
+void variadic2(int zzz, Args&&... args);
+
+void templates() {
+  variadic(/*xxx=*/0, /*yyy=*/1);
+  variadic2(/*zzU=*/0, /*xxx=*/1, /*yyy=*/2);
+  // CHECK-NOTES: [[@LINE-1]]:13: warning: argument name 'zzU' in comment does not match parameter name 'zzz'
+  // CHECK-NOTES: :[[@LINE-6]]:20: note: 'zzz' declared here
+  // CHECK-FIXES: variadic2(/*zzz=*/0, /*xxx=*/1, /*yyy=*/2);
+}
+
+#define FALSE 0
+void qqq(bool aaa);
+void f2() { qqq(/*bbb=*/FALSE); }
+// CHECK-NOTES: [[@LINE-1]]:17: warning: argument name 'bbb' in comment does not match parameter name 'aaa'
+// CHECK-NOTES: [[@LINE-3]]:15: note: 'aaa' declared here
+// CHECK-FIXES: void f2() { qqq(/*bbb=*/FALSE); }
+
+void f3(bool _with_underscores_);
+void ignores_underscores() {
+  f3(/*With_Underscores=*/false);
+}
+
+namespace IgnoresImplicit {
+struct S {
+  S(int x);
+  int x;
+};
+
+struct T {
+  // Use two arguments (one defaulted) because simplistic check for implicit
+  // constructor looks for only one argument. We need to default the argument so
+  // that it will still be triggered implicitly.  This is not contrived -- it
+  // comes up in real code, for example std::set(std::initializer_list...).
+  T(S s, int y = 0);
+};
+
+void k(T arg1);
+
+void mynewtest() {
+  int foo = 3;
+  k(/*arg1=*/S(foo));
+}
+} // namespace IgnoresImplicit
+
+namespace ThisEditDistanceAboveThreshold {
+void f4(int xxx);
+void g() { f4(/*xyz=*/0); }
+// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'xyz' in comment does not match parameter name 'xxx'
+// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
+// CHECK-FIXES: void g() { f4(/*xyz=*/0); }
+}
+
+namespace OtherEditDistanceAboveThreshold {
+void f5(int xxx, int yyy);
+void g() { f5(/*Zxx=*/0, 0); }
+// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'Zxx' in comment does not match parameter name 'xxx'
+// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
+// CHECK-FIXES: void g() { f5(/*xxx=*/0, 0); }
+struct C2 {
+  C2(int xxx, int yyy);
+};
+C2 c2(/*Zxx=*/0, 0);
+// CHECK-NOTES: [[@LINE-1]]:7: warning: argument name 'Zxx' in comment does not match parameter name 'xxx'
+// CHECK-NOTES: [[@LINE-4]]:10: note: 'xxx' declared here
+// CHECK-FIXES: C2 c2(/*xxx=*/0, 0);
+}
+
+namespace OtherEditDistanceBelowThreshold {
+void f6(int xxx, int yyy);
+void g() { f6(/*xxy=*/0, 0); }
+// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'xxy' in comment does not match parameter name 'xxx'
+// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
+// CHECK-FIXES: void g() { f6(/*xxy=*/0, 0); }
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-assert-side-effect.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-assert-side-effect.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-assert-side-effect.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-assert-side-effect.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,114 @@
+// RUN: %check_clang_tidy %s bugprone-assert-side-effect %t -- -config="{CheckOptions: [{key: bugprone-assert-side-effect.CheckFunctionCalls, value: 1}, {key: bugprone-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert,convoluted_assert,msvc_assert'}]}" -- -fexceptions
+
+//===--- assert definition block ------------------------------------------===//
+int abort() { return 0; }
+
+#ifdef NDEBUG
+#define assert(x) 1
+#else
+#define assert(x)                                                              \
+  if (!(x))                                                                    \
+  (void)abort()
+#endif
+
+void print(...);
+#define assert2(e) (__builtin_expect(!(e), 0) ?                                \
+                       print (#e, __FILE__, __LINE__) : (void)0)
+
+#ifdef NDEBUG
+#define my_assert(x) 1
+#else
+#define my_assert(x)                                                           \
+  ((void)((x) ? 1 : abort()))
+#endif
+
+#ifdef NDEBUG
+#define not_my_assert(x) 1
+#else
+#define not_my_assert(x)                                                       \
+  if (!(x))                                                                    \
+  (void)abort()
+#endif
+
+#define real_assert(x) ((void)((x) ? 1 : abort()))
+#define wrap1(x) real_assert(x)
+#define wrap2(x) wrap1(x)
+#define convoluted_assert(x) wrap2(x)
+
+#define msvc_assert(expression) (void)(                                        \
+            (!!(expression)) ||                                                \
+            (abort(), 0)                                                       \
+        )
+
+
+//===----------------------------------------------------------------------===//
+
+class MyClass {
+public:
+  bool badFunc(int a, int b) { return a * b > 0; }
+  bool goodFunc(int a, int b) const { return a * b > 0; }
+
+  MyClass &operator=(const MyClass &rhs) { return *this; }
+
+  int operator-() { return 1; }
+
+  operator bool() const { return true; }
+
+  void operator delete(void *p) {}
+};
+
+bool freeFunction() {
+  return true;
+}
+
+int main() {
+
+  int X = 0;
+  bool B = false;
+  assert(X == 1);
+
+  assert(X = 1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect [bugprone-assert-side-effect]
+  my_assert(X = 1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found my_assert() with side effect
+  convoluted_assert(X = 1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found convoluted_assert() with side effect
+  not_my_assert(X = 1);
+
+  assert(++X);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+  assert(!B);
+
+  assert(B || true);
+
+  assert(freeFunction());
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+
+  MyClass mc;
+  assert(mc.badFunc(0, 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+  assert(mc.goodFunc(0, 1));
+
+  MyClass mc2;
+  assert(mc2 = mc);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+
+  assert(-mc > 0);
+
+  MyClass *mcp;
+  assert(mcp = new MyClass);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+
+  assert((delete mcp, false));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+
+  assert((throw 1, false));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found assert() with side effect
+
+  assert2(1 == 2 - 1);
+
+  msvc_assert(mc2 = mc);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: found msvc_assert() with side effect
+
+  return 0;
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-bool-pointer-implicit-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-bool-pointer-implicit-conversion.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-bool-pointer-implicit-conversion.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-bool-pointer-implicit-conversion.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,82 @@
+// RUN: %check_clang_tidy %s bugprone-bool-pointer-implicit-conversion %t
+
+bool *SomeFunction();
+void SomeOtherFunction(bool*);
+bool F();
+void G(bool);
+
+
+template <typename T>
+void t(T b) {
+  if (b) {
+  }
+}
+
+void foo() {
+  bool *b = SomeFunction();
+  if (b) {
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: dubious check of 'bool *' against 'nullptr'
+// CHECK-FIXES: if (*b) {
+  }
+
+  if (F() && b) {
+// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: dubious check of 'bool *' against 'nullptr'
+// CHECK-FIXES: if (F() && *b) {
+  }
+
+  // TODO: warn here.
+  if (b) {
+    G(b);
+  }
+
+#define TESTMACRO if (b || F())
+
+  TESTMACRO {
+  }
+
+  t(b);
+
+  if (!b) {
+    // no-warning
+  }
+
+  if (SomeFunction()) {
+    // no-warning
+  }
+
+  bool *c = SomeFunction();
+  if (c) {
+    (void)c;
+    (void)*c; // no-warning
+  }
+
+  if (c) {
+    *c = true; // no-warning
+  }
+
+  if (c) {
+    c[0] = false; // no-warning
+  }
+
+  if (c) {
+    SomeOtherFunction(c); // no-warning
+  }
+
+  if (c) {
+    delete[] c; // no-warning
+  }
+
+  if (c) {
+    *(c) = false; // no-warning
+  }
+
+  struct {
+    bool *b;
+  } d = { SomeFunction() };
+
+  if (d.b)
+    (void)*d.b; // no-warning
+
+#define CHECK(b) if (b) {}
+  CHECK(c)
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone-macro-crash.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone-macro-crash.c?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone-macro-crash.c (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone-macro-crash.c Fri Oct 11 05:05:42 2019
@@ -0,0 +1,14 @@
+// RUN: %check_clang_tidy %s bugprone-branch-clone %t
+int x = 0;
+int y = 1;
+#define a(b, c) \
+  typeof(b) d;  \
+  if (b)        \
+    d = b;      \
+  else if (c)   \
+    d = b;
+
+f() {
+  // CHECK-MESSAGES: warning: repeated branch in conditional chain [bugprone-branch-clone]
+  a(x, y)
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-branch-clone.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,1026 @@
+// RUN: %check_clang_tidy %s bugprone-branch-clone %t -- -- -fno-delayed-template-parsing
+
+void test_basic1(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  else
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    out++;
+
+  out++;
+}
+
+void test_basic2(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  }
+  else {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    out++;
+  }
+
+  out++;
+}
+
+void test_basic3(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  }
+  else
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    out++;
+
+  out++;
+}
+
+void test_basic4(int in, int &out) {
+  if (in > 77) {
+    out--;
+  }
+  else {
+    out++;
+  }
+}
+
+void test_basic5(int in, int &out) {
+  if (in > 77) {
+    out++;
+  }
+  else {
+    out++;
+    out++;
+  }
+}
+
+void test_basic6(int in, int &out) {
+  if (in > 77) {
+    out++;
+  }
+  else {
+    out++, out++;
+  }
+}
+
+void test_basic7(int in, int &out) {
+  if (in > 77) {
+    out++;
+    out++;
+  }
+  else
+    out++;
+
+  out++;
+}
+
+void test_basic8(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+    out++;
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+    out++;
+    out++;
+  }
+
+  if (in % 2)
+    out++;
+}
+
+void test_basic9(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    if (in % 2)
+      out++;
+    else
+      out--;
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+    if (in % 2)
+      out++;
+    else
+      out--;
+  }
+}
+
+// If we remove the braces from the previous example, the check recognizes it
+// as an `else if`.
+void test_basic10(int in, int &out) {
+  if (in > 77)
+    if (in % 2)
+      out++;
+    else
+      out--;
+  else
+    if (in % 2)
+      out++;
+    else
+      out--;
+
+}
+
+void test_basic11(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    if (in % 2)
+      out++;
+    else
+      out--;
+    if (in % 3)
+      out++;
+    else
+      out--;
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+    if (in % 2)
+      out++;
+    else
+      out--;
+    if (in % 3)
+      out++;
+    else
+      out--;
+  }
+}
+
+void test_basic12(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+  }
+}
+
+void test_basic13(int in, int &out) {
+  if (in > 77) {
+    // Empty compound statement is not identical to null statement.
+  } else;
+}
+
+// We use a comparison that ignores redundant parentheses:
+void test_basic14(int in, int &out) {
+  if (in > 77)
+    out += 2;
+  else
+    (out) += (2);
+}
+
+void test_basic15(int in, int &out) {
+  if (in > 77)
+    ((out += 2));
+  else
+    out += 2;
+}
+
+// ..but does not apply additional simplifications:
+void test_basic16(int in, int &out) {
+  if (in > 77)
+    out += 2;
+  else
+    out += 1 + 1;
+}
+
+// ..and does not forget important parentheses:
+int test_basic17(int a, int b, int c, int mode) {
+  if (mode>8)
+    return (a + b) * c;
+  else
+    return a + b * c;
+}
+
+//=========--------------------==========//
+
+#define PASTE_CODE(x) x
+
+void test_macro1(int in, int &out) {
+  PASTE_CODE(
+    if (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone]
+      out++;
+    else
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+      out++;
+  )
+
+  out--;
+}
+
+void test_macro2(int in, int &out) {
+  PASTE_CODE(
+    if (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone]
+      out++;
+  )
+  else
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    out++;
+}
+
+void test_macro3(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  PASTE_CODE(
+    else
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+      out++;
+  )
+}
+
+void test_macro4(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  else
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    PASTE_CODE(
+      out++;
+    )
+}
+
+void test_macro5(int in, int &out) {
+  PASTE_CODE(if) (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  PASTE_CODE(else)
+// CHECK-MESSAGES: :[[@LINE-1]]:14: note: else branch starts here
+    out++;
+}
+
+#define OTHERWISE_INCREASE else out++
+
+void test_macro6(int in, int &out) {
+  if (in > 77)
+      out++;
+// CHECK-MESSAGES: :[[@LINE-2]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+  OTHERWISE_INCREASE;
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+// CHECK-MESSAGES: :[[@LINE-8]]:28: note: expanded from macro 'OTHERWISE_INCREASE'
+}
+
+#define COND_INCR(a, b, c) \
+  do {                     \
+    if ((a))               \
+      (b)++;               \
+    else                   \
+      (c)++;               \
+  } while (0)
+
+void test_macro7(int in, int &out1, int &out2) {
+  COND_INCR(in, out1, out1);
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE-9]]:5: note: expanded from macro 'COND_INCR'
+// CHECK-MESSAGES: :[[@LINE-3]]:3: note: else branch starts here
+// CHECK-MESSAGES: :[[@LINE-9]]:5: note: expanded from macro 'COND_INCR'
+}
+
+void test_macro8(int in, int &out1, int &out2) {
+  COND_INCR(in, out1, out2);
+}
+
+void test_macro9(int in, int &out1, int &out2) {
+  COND_INCR(in, out2, out2);
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE-21]]:5: note: expanded from macro 'COND_INCR'
+// CHECK-MESSAGES: :[[@LINE-3]]:3: note: else branch starts here
+// CHECK-MESSAGES: :[[@LINE-21]]:5: note: expanded from macro 'COND_INCR'
+}
+
+#define CONCAT(a, b) a##b
+
+void test_macro10(int in, int &out) {
+  CONCAT(i, f) (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    out++;
+  CONCAT(el, se)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    out++;
+}
+
+#define PROBLEM (-1)
+
+int test_macro11(int count) {
+  if (!count)
+    return PROBLEM;
+  else if (count == 13)
+    return -1;
+  else
+    return count * 2;
+}
+
+#define IF if (
+#define THEN ) {
+#define ELSE } else {
+#define END }
+
+void test_macro12(int in, int &out) {
+  IF in > 77 THEN
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE-8]]:12: note: expanded from macro 'IF'
+    out++;
+    out++;
+  ELSE
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+// CHECK-MESSAGES: :[[@LINE-11]]:16: note: expanded from macro 'ELSE'
+    out++;
+    out++;
+  END
+}
+
+// A hack for implementing a switch with no fallthrough:
+#define SWITCH(x) switch (x) {
+#define CASE(x) break; case (x):
+#define DEFAULT break; default:
+
+void test_macro13(int in, int &out) {
+  SWITCH(in)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+    CASE(1)
+      out++;
+      out++;
+    CASE(2)
+      out++;
+      out++;
+    CASE(3)
+      out++;
+      out++;
+// CHECK-MESSAGES: :[[@LINE-15]]:24: note: expanded from macro 'CASE'
+// CHECK-MESSAGES: :[[@LINE+1]]:9: note: last of these clones ends here
+    CASE(4)
+      out++;
+    CASE(5)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+    CASE(6)
+      out--;
+    CASE(7)
+      out--;
+// CHECK-MESSAGES: :[[@LINE-25]]:24: note: expanded from macro 'CASE'
+// CHECK-MESSAGES: :[[@LINE+2]]:9: note: last of these clones ends here
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+    CASE(8)
+      out++;
+      out++;
+    CASE(9)
+      out++;
+      out++;
+// CHECK-MESSAGES: :[[@LINE-34]]:24: note: expanded from macro 'CASE'
+// CHECK-MESSAGES: :[[@LINE+2]]:12: note: last of these clones ends here
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+    DEFAULT
+      out--;
+      out--;
+    CASE(10)
+      out--;
+      out--;
+// CHECK-MESSAGES: :[[@LINE-42]]:24: note: expanded from macro 'DEFAULT'
+// CHECK-MESSAGES: :[[@LINE+1]]:9: note: last of these clones ends here
+    CASE(12)
+      out++;
+    CASE(13)
+      out++;
+  END
+}
+
+//=========--------------------==========//
+
+void test_chain1(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
+  else if (in > 55)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
+    out++;
+
+  out++;
+}
+
+void test_chain2(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
+  else if (in > 55)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
+    out++;
+  else if (in > 42)
+    out--;
+  else if (in > 28)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 2 starts here
+    out++;
+  else if (in > 12) {
+    out++;
+    out *= 7;
+  } else if (in > 7) {
+// CHECK-MESSAGES: :[[@LINE-1]]:22: note: clone 3 starts here
+    out++;
+  }
+}
+
+void test_chain3(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+    out++;
+// CHECK-MESSAGES: :[[@LINE+1]]:4: note: end of the original
+  } else if (in > 55) {
+// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
+    out++;
+    out++;
+  } else if (in > 42)
+    out--;
+  else if (in > 28) {
+// CHECK-MESSAGES: :[[@LINE-1]]:21: note: clone 2 starts here
+    out++;
+    out++;
+  } else if (in > 12) {
+    out++;
+    out++;
+    out++;
+    out *= 7;
+  } else if (in > 7) {
+// CHECK-MESSAGES: :[[@LINE-1]]:22: note: clone 3 starts here
+    out++;
+    out++;
+  }
+}
+
+// In this chain there are two clone families; notice that the checker
+// describes all branches of the first one before mentioning the second one.
+void test_chain4(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+    out++;
+// CHECK-MESSAGES: :[[@LINE+1]]:4: note: end of the original
+  } else if (in > 55) {
+// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
+// CHECK-MESSAGES: :[[@LINE+8]]:21: note: clone 2 starts here
+// CHECK-MESSAGES: :[[@LINE+15]]:22: note: clone 3 starts here
+    out++;
+    out++;
+  } else if (in > 42)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out--;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
+  else if (in > 28) {
+    out++;
+    out++;
+  } else if (in > 12) {
+    out++;
+    out++;
+    out++;
+    out *= 7;
+  } else if (in > 7) {
+    out++;
+    out++;
+  } else if (in > -3) {
+// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
+    out--;
+  }
+}
+
+void test_chain5(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
+  else if (in > 55)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
+    out++;
+  else if (in > 42)
+    out--;
+  else if (in > 28)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 2 starts here
+    out++;
+  else if (in > 12) {
+    out++;
+    out *= 7;
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: clone 3 starts here
+    out++;
+  }
+}
+
+void test_chain6(int in, int &out) {
+  if (in > 77) {
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+    out++;
+// CHECK-MESSAGES: :[[@LINE+1]]:4: note: end of the original
+  } else if (in > 55) {
+// CHECK-MESSAGES: :[[@LINE-1]]:23: note: clone 1 starts here
+    out++;
+    out++;
+  } else if (in > 42)
+    out--;
+  else if (in > 28) {
+// CHECK-MESSAGES: :[[@LINE-1]]:21: note: clone 2 starts here
+    out++;
+    out++;
+  } else if (in > 12) {
+    out++;
+    out++;
+    out++;
+    out *= 7;
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: clone 3 starts here
+    out++;
+    out++;
+  }
+}
+
+void test_nested(int a, int b, int c, int &out) {
+  if (a > 5) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+27]]:5: note: else branch starts here
+    if (b > 5) {
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+9]]:6: note: end of the original
+// CHECK-MESSAGES: :[[@LINE+8]]:24: note: clone 1 starts here
+// CHECK-MESSAGES: :[[@LINE+14]]:12: note: clone 2 starts here
+      if (c > 5)
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
+        out++;
+      else
+// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
+        out++;
+    } else if (b > 15) {
+      if (c > 5)
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
+        out++;
+      else
+// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
+        out++;
+    } else {
+      if (c > 5)
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
+        out++;
+      else
+// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
+        out++;
+    }
+  } else {
+    if (b > 5) {
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: repeated branch in conditional chain [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+9]]:6: note: end of the original
+// CHECK-MESSAGES: :[[@LINE+8]]:24: note: clone 1 starts here
+// CHECK-MESSAGES: :[[@LINE+14]]:12: note: clone 2 starts here
+      if (c > 5)
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
+        out++;
+      else
+// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
+        out++;
+    } else if (b > 15) {
+      if (c > 5)
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
+        out++;
+      else
+// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
+        out++;
+    } else {
+      if (c > 5)
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: if with identical then and else branches [bugprone-branch-clone]
+        out++;
+      else
+// CHECK-MESSAGES: :[[@LINE-1]]:7: note: else branch starts here
+        out++;
+    }
+  }
+}
+
+//=========--------------------==========//
+
+template <class T>
+void test_template_not_instantiated(const T &t) {
+  int a;
+  if (t)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    a++;
+  else
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    a++;
+}
+
+template <class T>
+void test_template_instantiated(const T &t) {
+  int a;
+  if (t)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    a++;
+  else
+// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here
+    a++;
+}
+
+template void test_template_instantiated<int>(const int &t);
+
+template <class T>
+void test_template2(T t, int a) {
+  if (a) {
+    T b(0);
+    a += b;
+  } else {
+    int b(0);
+    a += b;
+  }
+}
+
+template void test_template2<int>(int t, int a);
+
+template <class T>
+void test_template3(T t, int a) {
+  if (a) {
+    T b(0);
+    a += b;
+  } else {
+    int b(0);
+    a += b;
+  }
+}
+
+template void test_template3<short>(short t, int a);
+
+template <class T>
+void test_template_two_instances(T t, int &a) {
+  if (a) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    a += int(t);
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+    a += int(t);
+  }
+}
+
+template void test_template_two_instances<short>(short t, int &a);
+template void test_template_two_instances<long>(long t, int &a);
+
+class C {
+  int member;
+  void inline_method(int arg) {
+    if (arg)
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone]
+      member = 3;
+    else
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+      member = 3;
+  }
+  int other_method();
+};
+
+int C::other_method() {
+  if (member) {
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
+    return 8;
+  } else {
+// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here
+    return 8;
+  }
+}
+
+//=========--------------------==========//
+
+int simple_switch(char ch) {
+  switch (ch) {
+// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+  case 'a':
+    return 10;
+  case 'A':
+    return 10;
+// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
+// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+  case 'b':
+    return 11;
+  case 'B':
+    return 11;
+// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
+// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+  case 'c':
+    return 10;
+  case 'C':
+    return 10;
+// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
+  default:
+    return 0;
+  }
+}
+
+int long_sequence_switch(char ch) {
+  switch (ch) {
+// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 7 consecutive identical branches [bugprone-branch-clone]
+  case 'a':
+    return 10;
+  case 'A':
+    return 10;
+  case 'b':
+    return 10;
+  case 'B':
+    return 10;
+  case 'c':
+    return 10;
+  case 'C':
+    return 10;
+  default:
+    return 10;
+// CHECK-MESSAGES: :[[@LINE-1]]:14: note: last of these clones ends here
+  }
+}
+
+int nested_switch(int a, int b, int c) {
+  switch (a) {
+// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+114]]:6: note: last of these clones ends here
+  case 1:
+    switch (b) {
+// CHECK-MESSAGES: :[[@LINE+2]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+33]]:8: note: last of these clones ends here
+    case 1:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    case 2:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    default:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    }
+  case 2:
+    switch (b) {
+// CHECK-MESSAGES: :[[@LINE+2]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+33]]:8: note: last of these clones ends here
+    case 1:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    case 2:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    default:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    }
+  default:
+    switch (b) {
+// CHECK-MESSAGES: :[[@LINE+2]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE+33]]:8: note: last of these clones ends here
+    case 1:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    case 2:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    default:
+      switch (c) {
+// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+      case 1:
+        return 42;
+      case 2:
+        return 42;
+      default:
+        return 42;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: note: last of these clones ends here
+      }
+    }
+  }
+}
+
+//=========--------------------==========//
+
+// This should not produce warnings, as in switch statements we only report
+// identical branches when they are consecutive. Also note that a branch
+// terminated by a break is different from a branch terminated by the end of
+// the switch statement.
+int interleaved_cases(int a, int b) {
+  switch (a) {
+  case 3:
+  case 4:
+    b = 2;
+    break;
+  case 5:
+    b = 3;
+    break;
+  case 6:
+    b = 2;
+    break;
+  case 7:
+    if (b % 2) {
+      b++;
+    } else {
+      b++;
+      break;
+    }
+    b = 2;
+    break;
+  case 8:
+    b = 2;
+  case 9:
+    b = 3;
+    break;
+  default:
+    b = 3;
+  }
+  return b;
+}
+
+
+// A case: or default: is only considered to be the start of a branch if it is a direct child of the CompoundStmt forming the body of the switch
+int buried_cases(int foo) {
+  switch (foo) {
+    {
+    case 36:
+      return 8;
+    default:
+      return 8;
+    }
+  }
+}
+
+// Here the `case 7:` is a child statement of the GotoLabelStmt, so the checker
+// thinks that it is part of the `case 9:` branch. While this result is
+// counterintuitve, mixing goto labels and switch statements in this fashion is
+// pretty rare, so it does not deserve a special case in the checker code.
+int decorated_cases(int z) {
+  if (!(z % 777)) {
+    goto lucky;
+  }
+  switch (z) {
+// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+  case 1:
+  case 2:
+  case 3:
+    z++;
+    break;
+  case 4:
+  case 5:
+    z++;
+    break;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: last of these clones ends here
+  case 9:
+    z++;
+    break;
+  lucky:
+  case 7:
+    z += 3;
+    z *= 2;
+    break;
+  case 92:
+    z += 3;
+    z *= 2;
+    break;
+  default:
+    z++;
+  }
+  return z + 92;
+}
+
+// The child of the switch statement is not neccessarily a compound statement,
+// do not crash in this unusual case.
+char no_real_body(int in, int &out) {
+  switch (in)
+  case 42:
+    return 'A';
+
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: repeated branch in conditional chain [bugprone-branch-clone]
+    out++;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: note: end of the original
+  else if (in > 55)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 1 starts here
+    out++;
+  else if (in > 34)
+// CHECK-MESSAGES: :[[@LINE+1]]:5: note: clone 2 starts here
+    out++;
+
+  return '|';
+}
+
+// Duff's device [https://en.wikipedia.org/wiki/Duff's_device]
+// The check does not try to distinguish branches in this sort of convoluted
+// code, but it should avoid crashing.
+void send(short *to, short *from, int count)
+{
+    int n = (count + 7) / 8;
+    switch (count % 8) {
+    case 0: do { *to = *from++;
+    case 7:      *to = *from++;
+    case 6:      *to = *from++;
+    case 5:      *to = *from++;
+    case 4:      *to = *from++;
+    case 3:      *to = *from++;
+    case 2:      *to = *from++;
+    case 1:      *to = *from++;
+            } while (--n > 0);
+    }
+}
+
+//=========--------------------==========//
+
+void ternary1(bool b, int &x) {
+// CHECK-MESSAGES: :[[@LINE+1]]:6: warning: conditional operator with identical true and false expressions [bugprone-branch-clone]
+  (b ? x : x) = 42;
+}
+
+int ternary2(bool b, int x) {
+// CHECK-MESSAGES: :[[@LINE+1]]:12: warning: conditional operator with identical true and false expressions [bugprone-branch-clone]
+  return b ? 42 : 42;
+}
+
+int ternary3(bool b, int x) {
+  return b ? 42 : 43;
+}
+
+int ternary4(bool b, int x) {
+  return b ? true ? 45 : 44 : false ? 45 : 44;
+}
+
+// We do not detect chains of conditional operators.
+int ternary5(bool b1, bool b2, int x) {
+  return b1 ? 42 : b2 ? 43 : 42;
+}
+
+#define SWITCH_WITH_LBRACE(b) switch (b) {
+#define SEMICOLON_CASE_COLON(b)                                                \
+  ;                                                                            \
+  case b:
+int d, e;
+void dontCrash() {
+  SWITCH_WITH_LBRACE(d)
+// CHECK-MESSAGES: :[[@LINE+1]]:3: warning: switch has 2 consecutive identical branches [bugprone-branch-clone]
+  SEMICOLON_CASE_COLON(1)
+    e++;
+    e++;
+  SEMICOLON_CASE_COLON(2)
+    e++;
+    e++;
+  // CHECK-MESSAGES: :[[@LINE-11]]:3: note: expanded from macro 'SEMICOLON_CASE_COLON'
+  // CHECK-MESSAGES: :[[@LINE+1]]:23: note: last of these clones ends here
+  SEMICOLON_CASE_COLON(3);
+  }
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-copy-constructor-init.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-copy-constructor-init.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-copy-constructor-init.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-copy-constructor-init.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,188 @@
+// RUN: %check_clang_tidy %s bugprone-copy-constructor-init %t
+
+class NonCopyable {
+public:
+  NonCopyable() = default;
+  NonCopyable(const NonCopyable &) = delete;
+
+private:
+  int a;
+};
+
+class NonCopyable2 {
+public:
+  NonCopyable2() = default;
+
+private:
+  NonCopyable2(const NonCopyable2 &);
+  int a;
+};
+
+class Copyable {
+public:
+  Copyable() = default;
+  Copyable(const Copyable &) = default;
+
+private:
+  int a;
+};
+
+class Copyable2 {
+public:
+  Copyable2() = default;
+  Copyable2(const Copyable2 &) = default;
+
+private:
+  int a;
+};
+
+class Copyable3 : public Copyable {
+public:
+  Copyable3() = default;
+  Copyable3(const Copyable3 &) = default;
+};
+
+template <class C>
+class Copyable4 {
+public:
+  Copyable4() = default;
+  Copyable4(const Copyable4 &) = default;
+
+private:
+  int a;
+};
+
+template <class T, class S>
+class Copyable5 {
+public:
+  Copyable5() = default;
+  Copyable5(const Copyable5 &) = default;
+
+private:
+  int a;
+};
+
+class EmptyCopyable {
+public:
+  EmptyCopyable() = default;
+  EmptyCopyable(const EmptyCopyable &) = default;
+};
+
+template <typename T>
+using CopyableAlias = Copyable5<T, int>;
+
+typedef Copyable5<int, int> CopyableAlias2;
+
+class X : public Copyable, public EmptyCopyable {
+  X(const X &other) : Copyable(other) {}
+};
+
+class X2 : public Copyable2 {
+  X2(const X2 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor other than the copy constructor [bugprone-copy-constructor-init]
+  // CHECK-FIXES: X2(const X2 &other)  : Copyable2(other) {}
+};
+
+class X2_A : public Copyable2 {
+  X2_A(const X2_A &) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X2_A(const X2_A &) {}
+};
+
+class X3 : public Copyable, public Copyable2 {
+  X3(const X3 &other) : Copyable(other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X3(const X3 &other) : Copyable(other) {}
+};
+
+class X4 : public Copyable {
+  X4(const X4 &other) : Copyable() {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X4(const X4 &other) : Copyable(other) {}
+};
+
+class X5 : public Copyable3 {
+  X5(const X5 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X5(const X5 &other)  : Copyable3(other) {}
+};
+
+class X6 : public Copyable2, public Copyable3 {
+  X6(const X6 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X6(const X6 &other)  : Copyable2(other), Copyable3(other) {}
+};
+
+class X7 : public Copyable, public Copyable2 {
+  X7(const X7 &other) : Copyable() {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X7(const X7 &other) : Copyable(other) {}
+};
+
+class X8 : public Copyable4<int> {
+  X8(const X8 &other) : Copyable4(other) {}
+};
+
+class X9 : public Copyable4<int> {
+  X9(const X9 &other) : Copyable4() {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X9(const X9 &other) : Copyable4(other) {}
+};
+
+class X10 : public Copyable4<int> {
+  X10(const X10 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X10(const X10 &other)  : Copyable4(other) {}
+};
+
+class X11 : public Copyable5<int, float> {
+  X11(const X11 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X11(const X11 &other)  : Copyable5(other) {}
+};
+
+class X12 : public CopyableAlias<float> {
+  X12(const X12 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X12(const X12 &other) {}
+};
+
+template <typename T>
+class X13 : T {
+  X13(const X13 &other) {}
+};
+
+template class X13<EmptyCopyable>;
+template class X13<Copyable>;
+
+#define FROMMACRO                \
+  class X14 : public Copyable2 { \
+    X14(const X14 &other) {}     \
+  };
+
+FROMMACRO
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: calling a base constructor
+
+class X15 : public CopyableAlias2 {
+  X15(const X15 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X15(const X15 &other) {}
+};
+
+class X16 : public NonCopyable {
+  X16(const X16 &other) {}
+};
+
+class X17 : public NonCopyable2 {
+  X17(const X17 &other) {}
+};
+
+class X18 : private Copyable {
+  X18(const X18 &other) {}
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
+  // CHECK-FIXES: X18(const X18 &other)  : Copyable(other) {}
+};
+
+class X19 : private Copyable {
+  X19(const X19 &other) : Copyable(other) {}
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dangling-handle.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dangling-handle.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dangling-handle.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dangling-handle.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,195 @@
+// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-dangling-handle %t -- \
+// RUN:   -config="{CheckOptions: \
+// RUN:             [{key: bugprone-dangling-handle.HandleClasses, \
+// RUN:               value: 'std::basic_string_view; ::llvm::StringRef;'}]}"
+// FIXME: Fix the checker to work in C++17 mode.
+
+namespace std {
+
+template <typename T>
+class vector {
+ public:
+  using const_iterator = const T*;
+  using iterator = T*;
+  using size_type = int;
+
+  void assign(size_type count, const T& value);
+  iterator insert(const_iterator pos, const T& value);
+  iterator insert(const_iterator pos, T&& value);
+  iterator insert(const_iterator pos, size_type count, const T& value);
+  void push_back(const T&);
+  void push_back(T&&);
+  void resize(size_type count, const T& value);
+};
+
+template <typename, typename>
+class pair {};
+
+template <typename T>
+class set {
+ public:
+  using const_iterator = const T*;
+  using iterator = T*;
+
+  std::pair<iterator, bool> insert(const T& value);
+  std::pair<iterator, bool> insert(T&& value);
+  iterator insert(const_iterator hint, const T& value);
+  iterator insert(const_iterator hint, T&& value);
+};
+
+template <typename Key, typename Value>
+class map {
+ public:
+  using value_type = pair<Key, Value>;
+  value_type& operator[](const Key& key);
+  value_type& operator[](Key&& key);
+};
+
+class basic_string_view;
+
+class basic_string {
+ public:
+  basic_string();
+  basic_string(const char*);
+
+  operator basic_string_view() const noexcept;
+
+  ~basic_string();
+};
+
+typedef basic_string string;
+
+class basic_string_view {
+ public:
+  basic_string_view(const char*);
+};
+
+typedef basic_string_view string_view;
+
+}  // namespace std
+
+namespace llvm {
+
+class StringRef {
+ public:
+  StringRef();
+  StringRef(const char*);
+  StringRef(const std::string&);
+};
+
+}  // namespace llvm
+
+std::string ReturnsAString();
+
+void Positives() {
+  std::string_view view1 = std::string();
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives its value [bugprone-dangling-handle]
+
+  std::string_view view_2 = ReturnsAString();
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives
+
+  view1 = std::string();
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+
+  const std::string& str_ref = "";
+  std::string_view view3 = true ? "A" : str_ref;
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives
+  view3 = true ? "A" : str_ref;
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+
+  std::string_view view4(ReturnsAString());
+  // CHECK-MESSAGES: [[@LINE-1]]:20: warning: std::basic_string_view outlives
+}
+
+void OtherTypes() {
+  llvm::StringRef ref = std::string();
+  // CHECK-MESSAGES: [[@LINE-1]]:19: warning: llvm::StringRef outlives its value
+}
+
+const char static_array[] = "A";
+std::string_view ReturnStatements(int i, std::string value_arg,
+                                  const std::string &ref_arg) {
+  const char array[] = "A";
+  const char* ptr = "A";
+  std::string s;
+  static std::string ss;
+  switch (i) {
+    // Bad cases
+    case 0:
+      return array;  // refers to local
+      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
+    case 1:
+      return s;  // refers to local
+      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
+    case 2:
+      return std::string();  // refers to temporary
+      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
+    case 3:
+      return value_arg;  // refers to by-value arg
+      // CHECK-MESSAGES: [[@LINE-1]]:7: warning: std::basic_string_view outliv
+
+    // Ok cases
+    case 100:
+      return ss;  // refers to static
+    case 101:
+      return static_array;  // refers to static
+    case 102:
+      return ptr;  // pointer is ok
+    case 103:
+      return ref_arg;  // refers to by-ref arg
+  }
+
+  struct S {
+    std::string_view view() { return value; }
+    std::string value;
+  };
+
+  (void)[&]()->std::string_view {
+    // This should not warn. The string is bound by reference.
+    return s;
+  };
+  (void)[=]() -> std::string_view {
+    // This should not warn. The reference is valid as long as the lambda.
+    return s;
+  };
+  (void)[=]() -> std::string_view {
+    // FIXME: This one should warn. We are returning a reference to a local
+    // lambda variable.
+    std::string local;
+    return local;
+  };
+  return "";
+}
+
+void Containers() {
+  std::vector<std::string_view> v;
+  v.assign(3, std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+  v.insert(nullptr, std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+  v.insert(nullptr, 3, std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+  v.push_back(std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+  v.resize(3, std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+
+  std::set<std::string_view> s;
+  s.insert(std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+  s.insert(nullptr, std::string());
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+
+  std::map<std::string_view, int> m;
+  m[std::string()];
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: std::basic_string_view outlives
+}
+
+void TakesAStringView(std::string_view);
+
+void Negatives(std::string_view default_arg = ReturnsAString()) {
+  std::string str;
+  std::string_view view = str;
+
+  TakesAStringView(std::string());
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dynamic-static-initializers.hpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dynamic-static-initializers.hpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dynamic-static-initializers.hpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-dynamic-static-initializers.hpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,44 @@
+// RUN: %check_clang_tidy %s bugprone-dynamic-static-initializers %t -- -- -fno-threadsafe-statics
+
+int fact(int n) {
+  return (n == 0) ? 1 : n * fact(n - 1);
+}
+
+int static_thing = fact(5);
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: static variable 'static_thing' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
+
+int sample() {
+    int x;
+    return x;
+}
+
+int dynamic_thing = sample();
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: static variable 'dynamic_thing' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
+
+int not_so_bad = 12 + 4942; // no warning
+
+extern int bar();
+
+int foo() {
+  static int k = bar();
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: static variable 'k' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
+  return k;
+}
+
+int bar2() {
+  return 7;
+}
+
+int foo2() {
+  // This may work fine when optimization is enabled because bar() can
+  // be turned into a constant 7.  But without optimization, it can
+  // cause problems. Therefore, we must err on the side of conservatism.
+  static int x = bar2();
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: static variable 'x' may be dynamically initialized in this header file [bugprone-dynamic-static-initializers]
+  return x;
+}
+
+int foo3() {
+  static int p = 7 + 83; // no warning
+  return p;
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape-openmp.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape-openmp.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape-openmp.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape-openmp.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,29 @@
+// RUN: %check_clang_tidy %s bugprone-exception-escape %t -- -extra-arg=-fopenmp=libomp -extra-arg=-fexceptions --
+
+int thrower() {
+  throw 42;
+}
+
+void ok_parallel() {
+#pragma omp parallel
+  thrower();
+}
+
+void bad_for_header_XFAIL(const int a) noexcept {
+#pragma omp for
+  for (int i = 0; i < thrower(); i++)
+    ;
+  // FIXME: this really should be caught by bugprone-exception-escape.
+  // https://bugs.llvm.org/show_bug.cgi?id=41102
+}
+
+void ok_forloop(const int a) {
+#pragma omp for
+  for (int i = 0; i < a; i++)
+    thrower();
+}
+
+void some_exception_just_so_that_check_clang_tidy_shuts_up() noexcept {
+  thrower();
+}
+// CHECK-MESSAGES: :[[@LINE-3]]:6: warning: an exception may be thrown in function 'some_exception_just_so_that_check_clang_tidy_shuts_up' which should not throw exceptions

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-exception-escape.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,295 @@
+// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-exception-escape %t -- \
+// RUN:     -config="{CheckOptions: [ \
+// RUN:         {key: bugprone-exception-escape.IgnoredExceptions, value: 'ignored1,ignored2'}, \
+// RUN:         {key: bugprone-exception-escape.FunctionsThatShouldNotThrow, value: 'enabled1,enabled2,enabled3'} \
+// RUN:     ]}" \
+// RUN:     -- -fexceptions
+
+struct throwing_destructor {
+  ~throwing_destructor() {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: an exception may be thrown in function '~throwing_destructor' which should not throw exceptions
+    throw 1;
+  }
+};
+
+struct throwing_move_constructor {
+  throwing_move_constructor(throwing_move_constructor&&) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: an exception may be thrown in function 'throwing_move_constructor' which should not throw exceptions
+    throw 1;
+  }
+};
+
+struct throwing_move_assignment {
+  throwing_move_assignment& operator=(throwing_move_assignment&&) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: an exception may be thrown in function 'operator=' which should not throw exceptions
+    throw 1;
+  }
+};
+
+void throwing_noexcept() noexcept {
+    // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throwing_noexcept' which should not throw exceptions
+  throw 1;
+}
+
+void throwing_throw_nothing() throw() {
+    // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throwing_throw_nothing' which should not throw exceptions
+  throw 1;
+}
+
+void throw_and_catch() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch' which should not throw exceptions
+  try {
+    throw 1;
+  } catch(int &) {
+  }
+}
+
+void throw_and_catch_some(int n) noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch_some' which should not throw exceptions
+  try {
+    if (n) throw 1;
+    throw 1.1;
+  } catch(int &) {
+  }
+}
+
+void throw_and_catch_each(int n) noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch_each' which should not throw exceptions
+  try {
+    if (n) throw 1;
+    throw 1.1;
+  } catch(int &) {
+  } catch(double &) {
+  }
+}
+
+void throw_and_catch_all(int n) noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_catch_all' which should not throw exceptions
+  try {
+    if (n) throw 1;
+    throw 1.1;
+  } catch(...) {
+  }
+}
+
+void throw_and_rethrow() noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_and_rethrow' which should not throw exceptions
+  try {
+    throw 1;
+  } catch(int &) {
+    throw;
+  }
+}
+
+void throw_catch_throw() noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_catch_throw' which should not throw exceptions
+  try {
+    throw 1;
+  } catch(int &) {
+    throw 2;
+  }
+}
+
+void throw_catch_rethrow_the_rest(int n) noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_catch_rethrow_the_rest' which should not throw exceptions
+  try {
+    if (n) throw 1;
+    throw 1.1;
+  } catch(int &) {
+  } catch(...) {
+    throw;
+  }
+}
+
+class base {};
+class derived: public base {};
+
+void throw_derived_catch_base() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throw_derived_catch_base' which should not throw exceptions
+  try {
+    throw derived();
+  } catch(base &) {
+  }
+}
+
+void try_nested_try(int n) noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'try_nested_try' which should not throw exceptions
+  try {
+    try {
+      if (n) throw 1;
+      throw 1.1;
+    } catch(int &) {
+    }
+  } catch(double &) {
+  }
+}
+
+void bad_try_nested_try(int n) noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'bad_try_nested_try' which should not throw exceptions
+  try {
+    if (n) throw 1;
+    try {
+      throw 1.1;
+    } catch(int &) {
+    }
+  } catch(double &) {
+  }
+}
+
+void try_nested_catch() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'try_nested_catch' which should not throw exceptions
+  try {
+    try {
+      throw 1;
+    } catch(int &) {
+      throw 1.1;
+    }
+  } catch(double &) {
+  }
+}
+
+void catch_nested_try() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'catch_nested_try' which should not throw exceptions
+  try {
+    throw 1;
+  } catch(int &) {
+    try {
+      throw 1;
+    } catch(int &) {
+    }
+  }
+}
+
+void bad_catch_nested_try() noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'bad_catch_nested_try' which should not throw exceptions
+  try {
+    throw 1;
+  } catch(int &) {
+    try {
+      throw 1.1;
+    } catch(int &) {
+    }
+  } catch(double &) {
+  }
+}
+
+void implicit_int_thrower() {
+  throw 1;
+}
+
+void explicit_int_thrower() throw(int);
+
+void indirect_implicit() noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'indirect_implicit' which should not throw exceptions
+  implicit_int_thrower();
+}
+
+void indirect_explicit() noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'indirect_explicit' which should not throw exceptions
+  explicit_int_thrower();
+}
+
+void indirect_catch() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'indirect_catch' which should not throw exceptions
+  try {
+    implicit_int_thrower();
+  } catch(int&) {
+  }
+}
+
+template<typename T>
+void dependent_throw() noexcept(sizeof(T)<4) {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'dependent_throw' which should not throw exceptions
+  if (sizeof(T) > 4)
+    throw 1;
+}
+
+void swap(int&, int&) {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'swap' which should not throw exceptions
+  throw 1;
+}
+
+namespace std {
+class bad_alloc {};
+}
+
+void alloc() {
+  throw std::bad_alloc();
+}
+
+void allocator() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'allocator' which should not throw exceptions
+  alloc();
+}
+
+void enabled1() {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'enabled1' which should not throw exceptions
+  throw 1;
+}
+
+void enabled2() {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'enabled2' which should not throw exceptions
+  enabled1();
+}
+
+void enabled3() {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'enabled3' which should not throw exceptions
+  try {
+    enabled1();
+  } catch(...) {
+  }
+}
+
+class ignored1 {};
+class ignored2 {};
+
+void this_does_not_count() noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'this_does_not_count' which should not throw exceptions
+  throw ignored1();
+}
+
+void this_does_not_count_either(int n) noexcept {
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'this_does_not_count_either' which should not throw exceptions
+  try {
+    throw 1;
+    if (n) throw ignored2();
+  } catch(int &) {
+  }
+}
+
+void this_counts(int n) noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'this_counts' which should not throw exceptions
+  if (n) throw 1;
+  throw ignored1();
+}
+
+void thrower(int n) {
+  throw n;
+}
+
+int directly_recursive(int n) noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'directly_recursive' which should not throw exceptions
+  if (n == 0)
+    thrower(n);
+  return directly_recursive(n);
+}
+
+int indirectly_recursive(int n) noexcept;
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'indirectly_recursive' which should not throw exceptions
+
+int recursion_helper(int n) {
+  indirectly_recursive(n);
+}
+
+int indirectly_recursive(int n) noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'indirectly_recursive' which should not throw exceptions
+  if (n == 0)
+    thrower(n);
+  return recursion_helper(n);
+}
+
+int main() {
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: an exception may be thrown in function 'main' which should not throw exceptions
+  throw 1;
+  return 0;
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-fold-init-type.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-fold-init-type.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-fold-init-type.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-fold-init-type.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,158 @@
+// RUN: %check_clang_tidy %s bugprone-fold-init-type %t
+
+namespace std {
+template <class InputIt, class T>
+T accumulate(InputIt first, InputIt last, T init);
+
+template <class InputIt, class T>
+T reduce(InputIt first, InputIt last, T init);
+template <class ExecutionPolicy, class InputIt, class T>
+T reduce(ExecutionPolicy &&policy,
+         InputIt first, InputIt last, T init);
+
+struct parallel_execution_policy {};
+constexpr parallel_execution_policy par{};
+
+template <class InputIt1, class InputIt2, class T>
+T inner_product(InputIt1 first1, InputIt1 last1,
+                InputIt2 first2, T value);
+
+template <class ExecutionPolicy, class InputIt1, class InputIt2, class T>
+T inner_product(ExecutionPolicy &&policy, InputIt1 first1, InputIt1 last1,
+                InputIt2 first2, T value);
+
+} // namespace std
+
+struct FloatIterator {
+  typedef float value_type;
+};
+template <typename ValueType>
+struct TypedefTemplateIterator { typedef ValueType value_type; };
+template <typename ValueType>
+struct UsingTemplateIterator { using value_type = ValueType; };
+template <typename ValueType>
+struct DependentTypedefTemplateIterator { typedef typename ValueType::value_type value_type; };
+template <typename ValueType>
+struct DependentUsingTemplateIterator : public TypedefTemplateIterator<ValueType> { using typename TypedefTemplateIterator<ValueType>::value_type; };
+using TypedeffedIterator = FloatIterator;
+
+// Positives.
+
+int accumulatePositive1() {
+  float a[1] = {0.5f};
+  return std::accumulate(a, a + 1, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+int accumulatePositive2() {
+  FloatIterator it;
+  return std::accumulate(it, it, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+int accumulatePositive3() {
+  double a[1] = {0.0};
+  return std::accumulate(a, a + 1, 0.0f);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'double' into type 'float'
+}
+
+int accumulatePositive4() {
+  TypedefTemplateIterator<unsigned> it;
+  return std::accumulate(it, it, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'unsigned int' into type 'int'
+}
+
+int accumulatePositive5() {
+  UsingTemplateIterator<unsigned> it;
+  return std::accumulate(it, it, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'unsigned int' into type 'int'
+}
+
+int accumulatePositive6() {
+  DependentTypedefTemplateIterator<UsingTemplateIterator<unsigned>> it;
+  return std::accumulate(it, it, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'unsigned int' into type 'int'
+}
+
+int accumulatePositive7() {
+  TypedeffedIterator it;
+  return std::accumulate(it, it, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+int accumulatePositive8() {
+  DependentUsingTemplateIterator<unsigned> it;
+  return std::accumulate(it, it, 0);
+  // FIXME: this one should trigger too.
+}
+
+int reducePositive1() {
+  float a[1] = {0.5f};
+  return std::reduce(a, a + 1, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+int reducePositive2() {
+  float a[1] = {0.5f};
+  return std::reduce(std::par, a, a + 1, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+int innerProductPositive1() {
+  float a[1] = {0.5f};
+  int b[1] = {1};
+  return std::inner_product(std::par, a, a + 1, b, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+int innerProductPositive2() {
+  float a[1] = {0.5f};
+  int b[1] = {1};
+  return std::inner_product(std::par, a, a + 1, b, 0);
+  // CHECK-MESSAGES: [[@LINE-1]]:10: warning: folding type 'float' into type 'int'
+}
+
+// Negatives.
+
+int negative1() {
+  float a[1] = {0.5f};
+  // This is OK because types match.
+  return std::accumulate(a, a + 1, 0.0);
+}
+
+int negative2() {
+  float a[1] = {0.5f};
+  // This is OK because double is bigger than float.
+  return std::accumulate(a, a + 1, 0.0);
+}
+
+int negative3() {
+  float a[1] = {0.5f};
+  // This is OK because the user explicitly specified T.
+  return std::accumulate<float *, float>(a, a + 1, 0);
+}
+
+int negative4() {
+  TypedefTemplateIterator<unsigned> it;
+  // For now this is OK.
+  return std::accumulate(it, it, 0.0);
+}
+
+int negative5() {
+  float a[1] = {0.5f};
+  float b[1] = {1.0f};
+  return std::inner_product(std::par, a, a + 1, b, 0.0f);
+}
+
+namespace blah {
+namespace std {
+template <class InputIt, class T>
+T accumulate(InputIt, InputIt, T); // We should not care about this one.
+}
+
+int negative5() {
+  float a[1] = {0.5f};
+  // Note that this is using blah::std::accumulate.
+  return std::accumulate(a, a + 1, 0);
+}
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forward-declaration-namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forward-declaration-namespace.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forward-declaration-namespace.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forward-declaration-namespace.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,163 @@
+// RUN: %check_clang_tidy %s bugprone-forward-declaration-namespace %t
+
+namespace {
+// This is a declaration in a wrong namespace.
+class T_A;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace 'na' [bugprone-forward-declaration-namespace]
+// CHECK-NOTES: note: a declaration of 'T_A' is found here
+// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)' [bugprone-forward-declaration-namespace]
+// CHECK-NOTES: note: a definition of 'T_A' is found here
+}
+
+namespace na {
+// This is a declaration in a wrong namespace.
+class T_A;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_A' is never referenced, but a declaration with the same name found in another namespace '(anonymous)'
+// CHECK-NOTES: note: a declaration of 'T_A' is found here
+// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_A', but a definition with the same name 'T_A' found in another namespace '(global)'
+// CHECK-NOTES: note: a definition of 'T_A' is found here
+}
+
+class T_A;
+
+class T_A {
+  int x;
+};
+
+class NESTED;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: no definition found for 'NESTED', but a definition with the same name 'NESTED' found in another namespace '(anonymous namespace)::nq::(anonymous)'
+// CHECK-NOTES: note: a definition of 'NESTED' is found here
+
+namespace {
+namespace nq {
+namespace {
+class NESTED {};
+}
+}
+}
+
+namespace na {
+class T_B;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb'
+// CHECK-NOTES: note: a declaration of 'T_B' is found here
+// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb'
+// CHECK-NOTES: note: a definition of 'T_B' is found here
+}
+
+namespace nb {
+class T_B;
+}
+
+namespace nb {
+class T_B {
+  int x;
+};
+}
+
+namespace na {
+class T_B;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'T_B' is never referenced, but a declaration with the same name found in another namespace 'nb'
+// CHECK-NOTES: note: a declaration of 'T_B' is found here
+// CHECK-NOTES: :[[@LINE-3]]:7: warning: no definition found for 'T_B', but a definition with the same name 'T_B' found in another namespace 'nb'
+// CHECK-NOTES: note: a definition of 'T_B' is found here
+}
+
+// A simple forward declaration. Although it is never used, but no declaration
+// with the same name is found in other namespace.
+class OUTSIDER;
+
+namespace na {
+// This class is referenced declaration, we don't generate warning.
+class OUTSIDER_1;
+}
+
+void f(na::OUTSIDER_1);
+
+namespace nc {
+// This class is referenced as friend in OOP.
+class OUTSIDER_1;
+
+class OOP {
+  friend struct OUTSIDER_1;
+};
+}
+
+namespace nd {
+class OUTSIDER_1;
+void f(OUTSIDER_1 *);
+}
+
+namespace nb {
+class OUTSIDER_1;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'OUTSIDER_1' is never referenced, but a declaration with the same name found in another namespace 'na'
+// CHECK-NOTES: note: a declaration of 'OUTSIDER_1' is found here
+}
+
+
+namespace na {
+template<typename T>
+class T_C;
+}
+
+namespace nb {
+// FIXME: this is an error, but we don't consider template class declaration
+// now.
+template<typename T>
+class T_C;
+}
+
+namespace na {
+template<typename T>
+class T_C {
+  int x;
+};
+}
+
+namespace na {
+
+template <typename T>
+class T_TEMP {
+  template <typename _Tp1>
+  struct rebind { typedef T_TEMP<_Tp1> other; };
+};
+
+// We ignore class template specialization.
+template class T_TEMP<char>;
+}
+
+namespace nb {
+
+template <typename T>
+class T_TEMP_1 {
+  template <typename _Tp1>
+  struct rebind { typedef T_TEMP_1<_Tp1> other; };
+};
+
+// We ignore class template specialization.
+extern template class T_TEMP_1<char>;
+}
+
+namespace nd {
+class D;
+// CHECK-NOTES: :[[@LINE-1]]:7: warning: declaration 'D' is never referenced, but a declaration with the same name found in another namespace 'nd::ne'
+// CHECK-NOTES: note: a declaration of 'D' is found here
+}
+
+namespace nd {
+namespace ne {
+class D;
+}
+}
+
+int f(nd::ne::D &d);
+
+
+// This should be ignored by the check.
+template <typename... Args>
+class Observer {
+  class Impl;
+};
+
+template <typename... Args>
+class Observer<Args...>::Impl {
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,152 @@
+// RUN: %check_clang_tidy %s bugprone-forwarding-reference-overload %t
+
+namespace std {
+template <bool B, class T = void> struct enable_if { typedef T type; };
+
+template <class T> struct enable_if<true, T> { typedef T type; };
+
+template <bool B, class T = void>
+using enable_if_t = typename enable_if<B, T>::type;
+
+template <class T> struct enable_if_nice { typedef T type; };
+} // namespace std
+
+namespace foo {
+template <class T> struct enable_if { typedef T type; };
+} // namespace foo
+
+template <typename T> constexpr bool just_true = true;
+
+class Test1 {
+public:
+  template <typename T> Test1(T &&n);
+  // CHECK-NOTES: [[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
+  // CHECK-NOTES: 48:3: note: copy constructor declared here
+  // CHECK-NOTES: 49:3: note: copy constructor declared here
+  // CHECK-NOTES: 50:3: note: move constructor declared here
+
+  template <typename T> Test1(T &&n, int i = 5, ...);
+  // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+  // CHECK-NOTES: 48:3: note: copy constructor declared here
+  // CHECK-NOTES: 49:3: note: copy constructor declared here
+  // CHECK-NOTES: 50:3: note: move constructor declared here
+
+  template <typename T, typename U = typename std::enable_if_nice<T>::type>
+  Test1(T &&n);
+  // CHECK-NOTES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+  // CHECK-NOTES: 48:3: note: copy constructor declared here
+  // CHECK-NOTES: 49:3: note: copy constructor declared here
+  // CHECK-NOTES: 50:3: note: move constructor declared here
+
+  template <typename T>
+  Test1(T &&n, typename foo::enable_if<long>::type i = 5, ...);
+  // CHECK-NOTES: :[[@LINE-1]]:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+  // CHECK-NOTES: 48:3: note: copy constructor declared here
+  // CHECK-NOTES: 49:3: note: copy constructor declared here
+  // CHECK-NOTES: 50:3: note: move constructor declared here
+
+  Test1(const Test1 &other) {}
+  Test1(Test1 &other) {}
+  Test1(Test1 &&other) {}
+};
+
+template <typename U> class Test2 {
+public:
+  // Two parameters without default value, can't act as copy / move constructor.
+  template <typename T, class V> Test2(T &&n, V &&m, int i = 5, ...);
+
+  // Guarded with enable_if.
+  template <typename T>
+  Test2(T &&n, int i = 5,
+        std::enable_if_t<sizeof(int) < sizeof(long), int> a = 5, ...);
+
+  // Guarded with enable_if.
+  template <typename T, typename X = typename std::enable_if<
+                            sizeof(int) < sizeof(long), double>::type &>
+  Test2(T &&n);
+
+  // Guarded with enable_if.
+  template <typename T>
+  Test2(T &&n, typename std::enable_if<just_true<T>>::type **a = nullptr);
+
+  // Guarded with enable_if.
+  template <typename T, typename X = std::enable_if_t<just_true<T>> *&&>
+  Test2(T &&n, double d = 0.0);
+
+  // Not a forwarding reference parameter.
+  template <typename T> Test2(const T &&n);
+
+  // Not a forwarding reference parameter.
+  Test2(int &&x);
+
+  // Two parameters without default value, can't act as copy / move constructor.
+  template <typename T> Test2(T &&n, int x);
+
+  // Not a forwarding reference parameter.
+  template <typename T> Test2(U &&n);
+};
+
+// The copy and move constructors are both disabled.
+class Test3 {
+public:
+  template <typename T> Test3(T &&n);
+
+  template <typename T> Test3(T &&n, int I = 5, ...);
+
+  Test3(const Test3 &rhs) = delete;
+
+private:
+  Test3(Test3 &&rhs);
+};
+
+// Both the copy and the (compiler generated) move constructors can be hidden.
+class Test4 {
+public:
+  template <typename T> Test4(T &&n);
+  // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+
+  Test4(const Test4 &rhs);
+  // CHECK-NOTES: :[[@LINE-1]]:3: note: copy constructor declared here
+};
+
+// Nothing can be hidden, the copy constructor is implicitly deleted.
+class Test5 {
+public:
+  template <typename T> Test5(T &&n);
+
+  Test5(Test5 &&rhs) = delete;
+};
+
+// Only the move constructor can be hidden.
+class Test6 {
+public:
+  template <typename T> Test6(T &&n);
+  // CHECK-NOTES: :[[@LINE-1]]:25: warning: constructor accepting a forwarding reference can hide the move constructor
+
+  Test6(Test6 &&rhs);
+  // CHECK-NOTES: :[[@LINE-1]]:3: note: move constructor declared here
+private:
+  Test6(const Test6 &rhs);
+};
+
+// Do not dereference a null BaseType.
+template <class _Callable> class result_of;
+template <class _Fp, class ..._Args> class result_of<_Fp(_Args...)> { };
+template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
+
+template <class... _Types> struct __overload;
+template <class _Tp, class... _Types>
+struct __overload<_Tp, _Types...> : __overload<_Types...> {
+  using __overload<_Types...>::operator();
+};
+
+template <class _Tp, class... _Types>
+using __best_match_t = typename result_of_t<__overload<_Types...>(_Tp&&)>::type;
+
+template <class... _Types>
+class variant {
+public:
+  template <class _Arg, class _Tp = __best_match_t<_Arg, _Types...> >
+  constexpr variant(_Arg&& __arg) {}
+  // CHECK-NOTES: :[[@LINE-1]]:13: warning: constructor accepting a forwarding reference can hide the copy and move constructors
+};

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-inaccurate-erase.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-inaccurate-erase.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-inaccurate-erase.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-inaccurate-erase.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,101 @@
+// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-inaccurate-erase %t
+// FIXME: Fix the checker to work in C++17 mode.
+
+namespace std {
+template <typename T> struct vec_iterator {
+  T ptr;
+  vec_iterator operator++(int);
+
+  template <typename X>
+  vec_iterator(const vec_iterator<X> &); // Omit enable_if<...>.
+};
+
+template <typename T> struct vector {
+  typedef vec_iterator<T*> iterator;
+
+  iterator begin();
+  iterator end();
+
+  void erase(iterator);
+  void erase(iterator, iterator);
+};
+
+template <typename T> struct vector_with_const_iterator {
+  typedef vec_iterator<T*> iterator;
+  typedef vec_iterator<const T*> const_iterator;
+
+  iterator begin();
+  iterator end();
+
+  void erase(const_iterator);
+  void erase(const_iterator, const_iterator);
+};
+
+template <typename FwIt, typename T>
+FwIt remove(FwIt begin, FwIt end, const T &val);
+
+template <typename FwIt, typename Func>
+FwIt remove_if(FwIt begin, FwIt end, Func f);
+
+template <typename FwIt> FwIt unique(FwIt begin, FwIt end);
+
+template <typename T> struct unique_ptr {};
+} // namespace std
+
+struct custom_iter {};
+struct custom_container {
+  void erase(...);
+  custom_iter begin();
+  custom_iter end();
+};
+
+template <typename T> void g() {
+  T t;
+  t.erase(std::remove(t.begin(), t.end(), 10));
+  // CHECK-FIXES: {{^  }}t.erase(std::remove(t.begin(), t.end(), 10));{{$}}
+
+  std::vector<int> v;
+  v.erase(remove(v.begin(), v.end(), 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
+  // CHECK-FIXES: {{^  }}v.erase(remove(v.begin(), v.end(), 10), v.end());{{$}}
+}
+
+#define ERASE(x, y) x.erase(remove(x.begin(), x.end(), y))
+// CHECK-FIXES: #define ERASE(x, y) x.erase(remove(x.begin(), x.end(), y))
+
+int main() {
+  std::vector<int> v;
+
+  v.erase(remove(v.begin(), v.end(), 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one item even when multiple items should be removed [bugprone-inaccurate-erase]
+  // CHECK-FIXES: {{^  }}v.erase(remove(v.begin(), v.end(), 10), v.end());{{$}}
+  v.erase(remove(v.begin(), v.end(), 20), v.end());
+
+  auto *p = &v;
+  p->erase(remove(p->begin(), p->end(), 11));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
+  // CHECK-FIXES: {{^  }}p->erase(remove(p->begin(), p->end(), 11), p->end());{{$}}
+
+  std::vector_with_const_iterator<int> v2;
+  v2.erase(remove(v2.begin(), v2.end(), 12));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
+  // CHECK-FIXES: {{^  }}v2.erase(remove(v2.begin(), v2.end(), 12), v2.end());{{$}}
+
+  // Fix is not trivial.
+  auto it = v.end();
+  v.erase(remove(v.begin(), it, 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this call will remove at most one
+  // CHECK-FIXES: {{^  }}v.erase(remove(v.begin(), it, 10));{{$}}
+
+  g<std::vector<int>>();
+  g<custom_container>();
+
+  ERASE(v, 15);
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: this call will remove at most one
+  // CHECK-FIXES: {{^  }}ERASE(v, 15);{{$}}
+
+  std::vector<std::unique_ptr<int>> vupi;
+  auto iter = vupi.begin();
+  vupi.erase(iter++);
+  // CHECK-FIXES: {{^  }}vupi.erase(iter++);{{$}}
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-incorrect-roundings.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-incorrect-roundings.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-incorrect-roundings.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-incorrect-roundings.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,86 @@
+// RUN: %check_clang_tidy %s bugprone-incorrect-roundings %t
+
+void b(int x) {}
+
+void f1() {
+  float f;
+  double d;
+  long double ld;
+  int x;
+
+  x = (d + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings]
+  x = (d + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (f + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (f + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (0.5 + d);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (0.5f + d);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (0.5 + ld);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (0.5f + ld);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (0.5 + f);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (0.5f + f);
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5)
+  x = (int)(d + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(d + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(ld + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(ld + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(f + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(f + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(0.5 + d);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(0.5f + d);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(0.5 + ld);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(0.5f + ld);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(0.5 + f);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = (int)(0.5f + f);
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: casting (double + 0.5)
+  x = static_cast<int>(d + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(d + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(ld + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(ld + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(f + 0.5);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(f + 0.5f);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(0.5 + d);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(0.5f + d);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(0.5 + ld);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(0.5f + ld);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(0.5 + f);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+  x = static_cast<int>(0.5f + f);
+  // CHECK-MESSAGES: [[@LINE-1]]:24: warning: casting (double + 0.5)
+
+  // Don't warn if constant is not 0.5.
+  x = (int)(d + 0.6);
+  x = (int)(0.6 + d);
+
+  // Don't warn if binary operator is not directly beneath cast.
+  x = (int)(1 + (0.5 + f));
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-infinite-loop.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-infinite-loop.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-infinite-loop.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-infinite-loop.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,320 @@
+// RUN: %check_clang_tidy %s bugprone-infinite-loop %t -- -- -fexceptions
+
+void simple_infinite_loop1() {
+  int i = 0;
+  int j = 0;
+  while (i < 10) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
+    j++;
+  }
+
+  do {
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
+    j++;
+  } while (i < 10);
+
+  for (i = 0; i < 10; ++j) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
+  }
+}
+
+void simple_infinite_loop2() {
+  int i = 0;
+  int j = 0;
+  int Limit = 10;
+  while (i < Limit) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i, Limit) are updated in the loop body [bugprone-infinite-loop]
+    j++;
+  }
+
+  do {
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i, Limit) are updated in the loop body [bugprone-infinite-loop]
+    j++;
+  } while (i < Limit);
+
+  for (i = 0; i < Limit; ++j) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i, Limit) are updated in the loop body [bugprone-infinite-loop]
+  }
+}
+
+void simple_not_infinite1() {
+  int i = 0;
+  int Limit = 100;
+  while (i < Limit) {
+    // Not an error since 'Limit' is updated.
+    Limit--;
+  }
+  do {
+    Limit--;
+  } while (i < Limit);
+
+  for (i = 0; i < Limit; Limit--) {
+  }
+}
+
+void simple_not_infinite2() {
+  for (int i = 10; i-- > 0;) {
+    // Not an error, since loop variable is modified in its condition part.
+  }
+}
+
+int unknown_function();
+
+void function_call() {
+  int i = 0;
+  while (i < unknown_function()) {
+    // Not an error, since the function may return different values.
+  }
+
+  do {
+    // Not an error, since the function may return different values.
+  } while (i < unknown_function());
+
+  for (i = 0; i < unknown_function();) {
+    // Not an error, since the function may return different values.
+  }
+}
+
+void escape_before1() {
+  int i = 0;
+  int Limit = 100;
+  int *p = &i;
+  while (i < Limit) {
+    // Not an error, since *p is alias of i.
+    (*p)++;
+  }
+
+  do {
+    (*p)++;
+  } while (i < Limit);
+
+  for (i = 0; i < Limit; ++(*p)) {
+  }
+}
+
+void escape_before2() {
+  int i = 0;
+  int Limit = 100;
+  int &ii = i;
+  while (i < Limit) {
+    // Not an error, since ii is alias of i.
+    ii++;
+  }
+
+  do {
+    ii++;
+  } while (i < Limit);
+
+  for (i = 0; i < Limit; ++ii) {
+  }
+}
+
+void escape_inside1() {
+  int i = 0;
+  int Limit = 100;
+  int *p = &i;
+  while (i < Limit) {
+    // Not an error, since *p is alias of i.
+    int *p = &i;
+    (*p)++;
+  }
+
+  do {
+    int *p = &i;
+    (*p)++;
+  } while (i < Limit);
+}
+
+void escape_inside2() {
+  int i = 0;
+  int Limit = 100;
+  while (i < Limit) {
+    // Not an error, since ii is alias of i.
+    int &ii = i;
+    ii++;
+  }
+
+  do {
+    int &ii = i;
+    ii++;
+  } while (i < Limit);
+}
+
+void escape_after1() {
+  int i = 0;
+  int j = 0;
+  int Limit = 10;
+
+  while (i < Limit) {
+    // False negative, but difficult to detect without CFG-based analysis
+  }
+  int *p = &i;
+}
+
+void escape_after2() {
+  int i = 0;
+  int j = 0;
+  int Limit = 10;
+
+  while (i < Limit) {
+    // False negative, but difficult to detect without CFG-based analysis
+  }
+  int &ii = i;
+}
+
+int glob;
+
+void global1(int &x) {
+  int i = 0, Limit = 100;
+  while (x < Limit) {
+    // Not an error since 'x' can be an alias of 'glob'.
+    glob++;
+  }
+}
+
+void global2() {
+  int i = 0, Limit = 100;
+  while (glob < Limit) {
+    // Since 'glob' is declared out of the function we do not warn.
+    i++;
+  }
+}
+
+struct X {
+  int m;
+
+  void change_m();
+
+  void member_expr1(int i) {
+    while (i < m) {
+      // False negative: No warning, since skipping the case where a struct or
+      // class can be found in its condition.
+      ;
+    }
+  }
+
+  void member_expr2(int i) {
+    while (i < m) {
+      --m;
+    }
+  }
+
+  void member_expr3(int i) {
+    while (i < m) {
+      change_m();
+    }
+  }
+};
+
+void array_index() {
+  int i = 0;
+  int v[10];
+  while (i < 10) {
+    v[i++] = 0;
+  }
+
+  i = 0;
+  do {
+    v[i++] = 0;
+  } while (i < 9);
+
+  for (i = 0; i < 10;) {
+    v[i++] = 0;
+  }
+
+  for (i = 0; i < 10; v[i++] = 0) {
+  }
+}
+
+void no_loop_variable() {
+  while (0)
+    ;
+}
+
+void volatile_in_condition() {
+  volatile int cond = 0;
+  while (!cond) {
+  }
+}
+
+namespace std {
+template<typename T> class atomic {
+  T val;
+public:
+  atomic(T v): val(v) {};
+  operator T() { return val; };
+};
+}
+
+void atomic_in_condition() {
+  std::atomic<int> cond = 0;
+  while (!cond) {
+  }
+}
+
+void loop_exit1() {
+  int i = 0;
+  while (i) {
+    if (unknown_function())
+      break;
+  }
+}
+
+void loop_exit2() {
+  int i = 0;
+  while (i) {
+    if (unknown_function())
+      return;
+  }
+}
+
+void loop_exit3() {
+  int i = 0;
+  while (i) {
+    if (unknown_function())
+      goto end;
+  }
+ end:
+  ;
+}
+
+void loop_exit4() {
+  int i = 0;
+  while (i) {
+    if (unknown_function())
+      throw 1;
+  }
+}
+
+[[noreturn]] void exit(int);
+
+void loop_exit5() {
+  int i = 0;
+  while (i) {
+    if (unknown_function())
+      exit(1);
+  }
+}
+
+void loop_exit_in_lambda() {
+  int i = 0;
+  while (i) {
+    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this loop is infinite; none of its condition variables (i) are updated in the loop body [bugprone-infinite-loop]
+    auto l = []() { return 0; };
+  }
+}
+
+void lambda_capture() {
+  int i = 0;
+  int Limit = 100;
+  int *p = &i;
+  while (i < Limit) {
+    // Not an error, since i is captured by reference in a lambda.
+    auto l = [&i]() { ++i; };
+  }
+
+  do {
+    int *p = &i;
+    (*p)++;
+  } while (i < Limit);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-integer-division.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-integer-division.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-integer-division.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-integer-division.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,130 @@
+// RUN: %check_clang_tidy %s bugprone-integer-division %t
+
+// Functions expecting a floating-point parameter.
+void floatArg(float x) {}
+void doubleArg(double x) {}
+void longDoubleArg(long double x) {}
+
+// Functions expected to return a floating-point value.
+float singleDiv() {
+  int x = -5;
+  int y = 2;
+  return x/y;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: result of integer division used in
+}
+
+double wrongOrder(int x, int y) {
+  return x/y/0.1;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: result of integer division used in
+}
+
+long double rightOrder(int x, int y) {
+  return 0.1/x/y; // OK
+}
+
+// Typical mathematical functions.
+float sin(float);
+double acos(double);
+long double tanh(long double);
+
+namespace std {
+  using ::sin;
+}
+
+template <typename T>
+void intDivSin(T x) {
+  sin(x);
+}
+
+int intFunc(int);
+
+struct X {
+  int n;
+  void m() {
+    sin(n / 3);
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: result of integer division used in
+  }
+};
+
+void integerDivision() {
+  char a = 2;
+  short b = -5;
+  int c = 9784;
+  enum third { x, y, z=2 };
+  third d = z;
+  char e[] = {'a', 'b', 'c'};
+  char f = *(e + 1 / a);
+  bool g = 1;
+
+  sin(1 + c / (2 + 2));
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: result of integer division used in
+  sin(c / (1 + .5));
+  sin((c + .5) / 3);
+
+  sin(intFunc(3) / 5);
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: result of integer division used in
+  acos(2 / intFunc(7));
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
+
+  floatArg(1 + 2 / 3);
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: result of integer division used in
+  sin(1 + 2 / 3);
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: result of integer division used in
+  intFunc(sin(1 + 2 / 3));
+// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: result of integer division used in
+
+  floatArg(1 + intFunc(1 + 2 / 3));
+  floatArg(1 + 3 * intFunc(a / b));
+
+  1 << (2 / 3);
+  1 << intFunc(2 / 3);
+
+#define M_SIN sin(a / b);
+  M_SIN
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: result of integer division used in
+
+  intDivSin<float>(a / b);
+// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: result of integer division used in
+  intDivSin<double>(c / d);
+// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: result of integer division used in
+  intDivSin<long double>(f / g);
+// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: result of integer division used in
+
+  floatArg(1 / 3);
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: result of integer division used in
+  doubleArg(a / b);
+// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: result of integer division used in
+  longDoubleArg(3 / d);
+// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: result of integer division used in
+  floatArg(a / b / 0.1);
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: result of integer division used in
+  doubleArg(1 / 3 / 0.1);
+// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: result of integer division used in
+  longDoubleArg(2 / 3 / 5);
+// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: result of integer division used in
+
+  std::sin(2 / 3);
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: result of integer division used in
+  ::acos(7 / d);
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: result of integer division used in
+  tanh(f / g);
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
+
+  floatArg(0.1 / a / b);
+  doubleArg(0.1 / 3 / 1);
+
+  singleDiv();
+  wrongOrder(a,b);
+  rightOrder(a,b);
+
+  sin(a / b);
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: result of integer division used in
+  acos(f / d);
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
+  tanh(c / g);
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: result of integer division used in
+
+  sin(3.0 / a);
+  acos(b / 3.14);
+  tanh(3.14 / f / g);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-lambda-function-name.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-lambda-function-name.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-lambda-function-name.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-lambda-function-name.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,41 @@
+// RUN: %check_clang_tidy %s bugprone-lambda-function-name %t
+
+void Foo(const char* a, const char* b, int c) {}
+
+#define FUNC_MACRO Foo(__func__, "", 0)
+#define FUNCTION_MACRO Foo(__FUNCTION__, "", 0)
+#define EMBED_IN_ANOTHER_MACRO1 FUNC_MACRO
+
+void Positives() {
+  [] { __func__; }();
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
+  [] { __FUNCTION__; }();
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__FUNCTION__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
+  [] { FUNC_MACRO; }();
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
+  [] { FUNCTION_MACRO; }();
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__FUNCTION__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
+  [] { EMBED_IN_ANOTHER_MACRO1; }();
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
+}
+
+#define FUNC_MACRO_WITH_FILE_AND_LINE Foo(__func__, __FILE__, __LINE__)
+#define FUNCTION_MACRO_WITH_FILE_AND_LINE Foo(__FUNCTION__, __FILE__, __LINE__)
+#define EMBED_IN_ANOTHER_MACRO2 FUNC_MACRO_WITH_FILE_AND_LINE
+
+void Negatives() {
+  __func__;
+  __FUNCTION__;
+
+  // __PRETTY_FUNCTION__ should not trigger a warning because its value is
+  // actually potentially useful.
+  __PRETTY_FUNCTION__;
+  [] { __PRETTY_FUNCTION__; }();
+
+  // Don't warn if __func__/__FUNCTION is used inside a macro that also uses
+  // __FILE__ and __LINE__, on the assumption that __FILE__ and __LINE__ will
+  // be useful even if __func__/__FUNCTION__ is not.
+  [] { FUNC_MACRO_WITH_FILE_AND_LINE; }();
+  [] { FUNCTION_MACRO_WITH_FILE_AND_LINE; }();
+  [] { EMBED_IN_ANOTHER_MACRO2; }();
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses-cmdline.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses-cmdline.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses-cmdline.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses-cmdline.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,10 @@
+// RUN: %check_clang_tidy %s bugprone-macro-parentheses %t -- -- -DVAL=0+0
+
+// The previous command-line is producing warnings and fixes with the source
+// locations from a virtual buffer. VAL is replaced by '0+0'.
+// Fixes could not be applied and should not be reported.
+int foo() { return VAL; }
+
+#define V 0+0
+int bar() { return V; }
+// CHECK-FIXES: #define V (0+0)

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,49 @@
+// RUN: %check_clang_tidy %s bugprone-macro-parentheses %t
+
+#define BAD1              -1
+// CHECK-MESSAGES: :[[@LINE-1]]:27: warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
+#define BAD2              1+2
+// CHECK-MESSAGES: :[[@LINE-1]]:28: warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
+#define BAD3(A)           (A+1)
+// CHECK-MESSAGES: :[[@LINE-1]]:28: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
+#define BAD4(x)           ((unsigned char)(x & 0xff))
+// CHECK-MESSAGES: :[[@LINE-1]]:44: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
+#define BAD5(X)           A*B=(C*)X+2
+// CHECK-MESSAGES: :[[@LINE-1]]:35: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
+
+#define GOOD1             1
+#define GOOD2             (1+2)
+#define GOOD3(A)          #A
+#define GOOD4(A,B)        A ## B
+#define GOOD5(T)          ((T*)0)
+#define GOOD6(B)          "A" B "C"
+#define GOOD7(b)          A b
+#define GOOD8(a)          a B
+#define GOOD9(type)       (type(123))
+#define GOOD10(car, ...)  car
+#define GOOD11            a[b+c]
+#define GOOD12(x)         a[x]
+#define GOOD13(x)         a.x
+#define GOOD14(x)         a->x
+#define GOOD15(x)         ({ int a = x; a+4; })
+#define GOOD16(x)         a_ ## x, b_ ## x = c_ ## x - 1,
+#define GOOD17            case 123: x=4+5; break;
+#define GOOD18(x)         ;x;
+#define GOOD19            ;-2;
+#define GOOD20            void*
+#define GOOD21(a)         case Fred::a:
+#define GOOD22(a)         if (verbose) return a;
+#define GOOD23(type)      (type::Field)
+#define GOOD24(t)         std::set<t> s
+#define GOOD25(t)         std::set<t,t,t> s
+#define GOOD26(x)         (a->*x)
+#define GOOD27(x)         (a.*x)
+#define GOOD28(x)         namespace x {int b;}
+#define GOOD29(...)       std::cout << __VA_ARGS__;
+#define GOOD30(args...)   std::cout << args;
+#define GOOD31(X)         A*X=2
+#define GOOD32(X)         std::vector<X>
+
+// These are allowed for now..
+#define MAYBE1            *12.34
+#define MAYBE2            <<3

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-repeated-side-effects.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-repeated-side-effects.c?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-repeated-side-effects.c (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-macro-repeated-side-effects.c Fri Oct 11 05:05:42 2019
@@ -0,0 +1,125 @@
+// RUN: %check_clang_tidy %s bugprone-macro-repeated-side-effects %t
+
+#define badA(x,y)  ((x)+((x)+(y))+(y))
+void bad(int ret, int a, int b) {
+  ret = badA(a++, b);
+  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x' are repeated in macro expansion [bugprone-macro-repeated-side-effects]
+  // CHECK-NOTES: :[[@LINE-4]]:9: note: macro 'badA' defined here
+  ret = badA(++a, b);
+  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x'
+  // CHECK-NOTES: :[[@LINE-7]]:9: note: macro 'badA' defined here
+  ret = badA(a--, b);
+  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x'
+  // CHECK-NOTES: :[[@LINE-10]]:9: note: macro 'badA' defined here
+  ret = badA(--a, b);
+  // CHECK-NOTES: :[[@LINE-1]]:14: warning: side effects in the 1st macro argument 'x'
+  // CHECK-NOTES: :[[@LINE-13]]:9: note: macro 'badA' defined here
+  ret = badA(a, b++);
+  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
+  // CHECK-NOTES: :[[@LINE-16]]:9: note: macro 'badA' defined here
+  ret = badA(a, ++b);
+  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
+  // CHECK-NOTES: :[[@LINE-19]]:9: note: macro 'badA' defined here
+  ret = badA(a, b--);
+  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
+  // CHECK-NOTES: :[[@LINE-22]]:9: note: macro 'badA' defined here
+  ret = badA(a, --b);
+  // CHECK-NOTES: :[[@LINE-1]]:17: warning: side effects in the 2nd macro argument 'y'
+  // CHECK-NOTES: :[[@LINE-25]]:9: note: macro 'badA' defined here
+}
+
+
+#define MIN(A,B)     ((A) < (B) ? (A) : (B))                        // single ?:
+#define LIMIT(X,A,B) ((X) < (A) ? (A) : ((X) > (B) ? (B) : (X)))    // two ?:
+void question(int x) {
+  MIN(x++, 12);
+  // CHECK-NOTES: :[[@LINE-1]]:7: warning: side effects in the 1st macro argument 'A'
+  // CHECK-NOTES: :[[@LINE-5]]:9: note: macro 'MIN' defined here
+  MIN(34, x++);
+  // CHECK-NOTES: :[[@LINE-1]]:11: warning: side effects in the 2nd macro argument 'B'
+  // CHECK-NOTES: :[[@LINE-8]]:9: note: macro 'MIN' defined here
+  LIMIT(x++, 0, 100);
+  // CHECK-NOTES: :[[@LINE-1]]:9: warning: side effects in the 1st macro argument 'X'
+  // CHECK-NOTES: :[[@LINE-10]]:9: note: macro 'LIMIT' defined here
+  LIMIT(20, x++, 100);
+  // CHECK-NOTES: :[[@LINE-1]]:13: warning: side effects in the 2nd macro argument 'A'
+  // CHECK-NOTES: :[[@LINE-13]]:9: note: macro 'LIMIT' defined here
+  LIMIT(20, 0, x++);
+  // CHECK-NOTES: :[[@LINE-1]]:16: warning: side effects in the 3rd macro argument 'B'
+  // CHECK-NOTES: :[[@LINE-16]]:9: note: macro 'LIMIT' defined here
+}
+
+// False positive: Repeated side effects is intentional.
+// It is hard to know when it's done by intention so right now we warn.
+#define UNROLL(A)    {A A}
+void fp1(int i) {
+  UNROLL({ i++; });
+  // CHECK-NOTES: :[[@LINE-1]]:10: warning: side effects in the 1st macro argument 'A'
+  // CHECK-NOTES: :[[@LINE-4]]:9: note: macro 'UNROLL' defined here
+}
+
+// Do not produce a false positive on a strchr() macro. Explanation; Currently the '?'
+// triggers the test to bail out, because it cannot evaluate __builtin_constant_p(c).
+#  define strchrs(s, c) \
+  (__extension__ (__builtin_constant_p (c) && !__builtin_constant_p (s)	      \
+		  && (c) == '\0'					      \
+		  ? (char *) __rawmemchr (s, c)				      \
+		  : __builtin_strchr (s, c)))
+char* __rawmemchr(char* a, char b) {
+  return a;
+}
+void pass(char* pstr, char ch) {
+  strchrs(pstr, ch++); // No error.
+}
+
+// Check large arguments (t=20, u=21).
+#define largeA(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y, z) \
+  ((a) + (a) + (b) + (b) + (c) + (c) + (d) + (d) + (e) + (e) + (f) + (f) + (g) + (g) +    \
+   (h) + (h) + (i) + (i) + (j) + (j) + (k) + (k) + (l) + (l) + (m) + (m) + (n) + (n) +    \
+   (o) + (o) + (p) + (p) + (q) + (q) + (r) + (r) + (s) + (s) + (t) + (t) + (u) + (u) +    \
+   (v) + (v) + (x) + (x) + (y) + (y) + (z) + (z))
+void large(int a) {
+  largeA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a++, 0, 0, 0, 0, 0, 0);
+  // CHECK-NOTES: :[[@LINE-1]]:64: warning: side effects in the 19th macro argument 's'
+  // CHECK-NOTES: :[[@LINE-8]]:9: note: macro 'largeA' defined here
+  largeA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a++, 0, 0, 0, 0, 0);
+  // CHECK-NOTES: :[[@LINE-1]]:67: warning: side effects in the 20th macro argument 't'
+  // CHECK-NOTES: :[[@LINE-11]]:9: note: macro 'largeA' defined here
+  largeA(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a++, 0, 0, 0, 0);
+  // CHECK-NOTES: :[[@LINE-1]]:70: warning: side effects in the 21st macro argument 'u'
+  // CHECK-NOTES: :[[@LINE-14]]:9: note: macro 'largeA' defined here
+}
+
+// Passing macro argument as argument to __builtin_constant_p and macros.
+#define builtinbad(x)      (__builtin_constant_p(x) + (x) + (x))
+#define builtingood1(x)    (__builtin_constant_p(x) + (x))
+#define builtingood2(x)    ((__builtin_constant_p(x) && (x)) || (x))
+#define macrobad(x)        (builtingood1(x) + (x) + (x))
+#define macrogood(x)       (builtingood1(x) + (x))
+void builtins(int ret, int a) {
+  ret += builtinbad(a++);
+  // CHECK-NOTES: :[[@LINE-1]]:21: warning: side effects in the 1st macro argument 'x'
+  // CHECK-NOTES: :[[@LINE-8]]:9: note: macro 'builtinbad' defined here
+
+  ret += builtingood1(a++);
+  ret += builtingood2(a++);
+
+  ret += macrobad(a++);
+  // CHECK-NOTES: :[[@LINE-1]]:19: warning: side effects in the 1st macro argument 'x'
+  // CHECK-NOTES: :[[@LINE-12]]:9: note: macro 'macrobad' defined here
+
+  ret += macrogood(a++);
+}
+
+// Bail out for conditionals.
+#define condB(x,y)  if(x) {x=y;} else {x=y + 1;}
+void conditionals(int a, int b)
+{
+  condB(a, b++);
+}
+
+void log(const char *s, int v);
+#define LOG(val) log(#val, (val))
+void test_log(int a) {
+  LOG(a++);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.c?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.c (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.c Fri Oct 11 05:05:42 2019
@@ -0,0 +1,85 @@
+// RUN: %check_clang_tidy %s bugprone-misplaced-operator-in-strlen-in-alloc %t
+
+typedef __typeof(sizeof(int)) size_t;
+void *malloc(size_t);
+void *alloca(size_t);
+void *calloc(size_t, size_t);
+void *realloc(void *, size_t);
+
+size_t strlen(const char *);
+size_t strnlen(const char *, size_t);
+size_t strnlen_s(const char *, size_t);
+
+typedef unsigned wchar_t;
+
+size_t wcslen(const wchar_t *);
+size_t wcsnlen(const wchar_t *, size_t);
+size_t wcsnlen_s(const wchar_t *, size_t);
+
+void bad_malloc(char *name) {
+  char *new_name = (char *)malloc(strlen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)malloc\(}}strlen(name) + 1{{\);$}}
+  new_name = (char *)malloc(strnlen(name + 1, 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: addition operator is applied to the argument of strnlen
+  // CHECK-FIXES: {{^  new_name = \(char \*\)malloc\(}}strnlen(name, 10) + 1{{\);$}}
+  new_name = (char *)malloc(strnlen_s(name + 1, 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: addition operator is applied to the argument of strnlen_s
+  // CHECK-FIXES: {{^  new_name = \(char \*\)malloc\(}}strnlen_s(name, 10) + 1{{\);$}}
+}
+
+void bad_malloc_wide(wchar_t *name) {
+  wchar_t *new_name = (wchar_t *)malloc(wcslen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: addition operator is applied to the argument of wcslen
+  // CHECK-FIXES: {{^  wchar_t \*new_name = \(wchar_t \*\)malloc\(}}wcslen(name) + 1{{\);$}}
+  new_name = (wchar_t *)malloc(wcsnlen(name + 1, 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: addition operator is applied to the argument of wcsnlen
+  // CHECK-FIXES: {{^  new_name = \(wchar_t \*\)malloc\(}}wcsnlen(name, 10) + 1{{\);$}}
+  new_name = (wchar_t *)malloc(wcsnlen_s(name + 1, 10));
+  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: addition operator is applied to the argument of wcsnlen_s
+  // CHECK-FIXES: {{^  new_name = \(wchar_t \*\)malloc\(}}wcsnlen_s(name, 10) + 1{{\);$}}
+}
+
+void bad_alloca(char *name) {
+  char *new_name = (char *)alloca(strlen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)alloca\(}}strlen(name) + 1{{\);$}}
+}
+
+void bad_calloc(char *name) {
+  char *new_names = (char *)calloc(2, strlen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_names = \(char \*\)calloc\(2, }}strlen(name) + 1{{\);$}}
+}
+
+void bad_realloc(char *old_name, char *name) {
+  char *new_name = (char *)realloc(old_name, strlen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)realloc\(old_name, }}strlen(name) + 1{{\);$}}
+}
+
+void intentional1(char *name) {
+  char *new_name = (char *)malloc(strlen(name + 1) + 1);
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // We have + 1 outside as well so we assume this is intentional
+}
+
+void intentional2(char *name) {
+  char *new_name = (char *)malloc(strlen(name + 2));
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // Only give warning for + 1, not + 2
+}
+
+void intentional3(char *name) {
+  char *new_name = (char *)malloc(strlen((name + 1)));
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // If expression is in extra parentheses, consider it as intentional
+}
+
+void (*(*const alloc_ptr)(size_t)) = malloc;
+
+void bad_indirect_alloc(char *name) {
+  char *new_name = (char *)alloc_ptr(strlen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)alloc_ptr\(}}strlen(name) + 1{{\);$}}
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-operator-in-strlen-in-alloc.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,58 @@
+// RUN: %check_clang_tidy %s bugprone-misplaced-operator-in-strlen-in-alloc %t
+
+namespace std {
+typedef __typeof(sizeof(int)) size_t;
+void *malloc(size_t);
+
+size_t strlen(const char *);
+} // namespace std
+
+namespace non_std {
+typedef __typeof(sizeof(int)) size_t;
+void *malloc(size_t);
+
+size_t strlen(const char *);
+} // namespace non_std
+
+void bad_std_malloc_std_strlen(char *name) {
+  char *new_name = (char *)std::malloc(std::strlen(name + 1));
+  // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_name = \(char \*\)std::malloc\(}}std::strlen(name) + 1{{\);$}}
+}
+
+void ignore_non_std_malloc_std_strlen(char *name) {
+  char *new_name = (char *)non_std::malloc(std::strlen(name + 1));
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // Ignore functions of the malloc family in custom namespaces
+}
+
+void ignore_std_malloc_non_std_strlen(char *name) {
+  char *new_name = (char *)std::malloc(non_std::strlen(name + 1));
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:28: warning: addition operator is applied to the argument of strlen
+  // Ignore functions of the strlen family in custom namespaces
+}
+
+void bad_new_strlen(char *name) {
+  char *new_name = new char[std::strlen(name + 1)];
+  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  char \*new_name = new char\[}}std::strlen(name) + 1{{\];$}}
+}
+
+void good_new_strlen(char *name) {
+  char *new_name = new char[std::strlen(name) + 1];
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:20: warning: addition operator is applied to the argument of strlen
+}
+
+class C {
+  char c;
+public:
+  static void *operator new[](std::size_t count) {
+    return ::operator new(count);
+  }
+};
+
+void bad_custom_new_strlen(char *name) {
+  C *new_name = new C[std::strlen(name + 1)];
+  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: addition operator is applied to the argument of strlen
+  // CHECK-FIXES: {{^  C \*new_name = new C\[}}std::strlen(name) + 1{{\];$}}
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-explicit-only.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-explicit-only.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-explicit-only.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-explicit-only.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,82 @@
+// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: 0}]}" --
+
+void func(long arg) {}
+
+void assign(int a, int b) {
+  long l;
+
+  l = a * b;
+  l = (long)(a * b);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long' is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
+  l = (long)a * b;
+
+  l = a << 8;
+  l = (long)(a << 8);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = (long)b << 8;
+
+  l = static_cast<long>(a * b);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+}
+
+void compare(int a, int b, long c) {
+  bool l;
+
+  l = a * b == c;
+  l = c == a * b;
+  l = (long)(a * b) == c;
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = c == (long)(a * b);
+  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
+  l = (long)a * b == c;
+  l = c == (long)a * b;
+}
+
+void init(unsigned int n) {
+  long l1 = n << 8;
+  long l2 = (long)(n << 8);
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: either cast from 'unsigned int' to 'long'
+  long l3 = (long)n << 8;
+}
+
+void call(unsigned int n) {
+  func(n << 8);
+  func((long)(n << 8));
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: either cast from 'unsigned int' to 'long'
+  func((long)n << 8);
+}
+
+long ret(int a) {
+  if (a < 0) {
+    return a * 1000;
+  } else if (a > 0) {
+    return (long)(a * 1000);
+    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
+  } else {
+    return (long)a * 1000;
+  }
+}
+
+// Shall not generate an assert. https://bugs.llvm.org/show_bug.cgi?id=33660
+template <class> class A {
+  enum Type {};
+  static char *m_fn1() { char p = (Type)(&p - m_fn1()); }
+};
+
+enum DaysEnum {
+  MON,
+  TUE,
+  WED,
+  THR,
+  FRI,
+  SAT,
+  SUN
+};
+
+// Do not warn for int to enum casts.
+void nextDay(DaysEnum day) {
+  if (day < SUN)
+    day = (DaysEnum)(day + 1);
+  if (day < SUN)
+    day = static_cast<DaysEnum>(day + 1);
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-implicit-enabled.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-implicit-enabled.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-implicit-enabled.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-misplaced-widening-cast-implicit-enabled.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,101 @@
+// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: 1}]}" --
+
+void func(long arg) {}
+
+void assign(int a, int b) {
+  long l;
+
+  l = a * b;
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long' is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
+  l = (long)(a * b);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = (long)a * b;
+
+  l = a << 8;
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = (long)(a << 8);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = (long)b << 8;
+
+  l = static_cast<long>(a * b);
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+}
+
+void compare(int a, int b, long c) {
+  bool l;
+
+  l = a * b == c;
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = c == a * b;
+  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
+  l = (long)(a * b) == c;
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: either cast from 'int' to 'long'
+  l = c == (long)(a * b);
+  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
+  l = (long)a * b == c;
+  l = c == (long)a * b;
+}
+
+void init(unsigned int n) {
+  long l1 = n << 8;
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: either cast from 'unsigned int' to 'long'
+  long l2 = (long)(n << 8);
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: either cast from 'unsigned int' to 'long'
+  long l3 = (long)n << 8;
+}
+
+void call(unsigned int n) {
+  func(n << 8);
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: either cast from 'unsigned int' to 'long'
+  func((long)(n << 8));
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: either cast from 'unsigned int' to 'long'
+  func((long)n << 8);
+}
+
+long ret(int a) {
+  if (a < 0) {
+    return a * 1000;
+    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
+  } else if (a > 0) {
+    return (long)(a * 1000);
+    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: either cast from 'int' to 'long'
+  } else {
+    return (long)a * 1000;
+  }
+}
+
+void dontwarn1(unsigned char a, int i, unsigned char *p) {
+  long l;
+  // The result is a 9 bit value, there is no truncation in the implicit cast.
+  l = (long)(a + 15);
+  // The result is a 12 bit value, there is no truncation in the implicit cast.
+  l = (long)(a << 4);
+  // The result is a 3 bit value, there is no truncation in the implicit cast.
+  l = (long)((i % 5) + 1);
+  // The result is a 16 bit value, there is no truncation in the implicit cast.
+  l = (long)(((*p) << 8) + *(p + 1));
+}
+
+template <class T> struct DontWarn2 {
+  void assign(T a, T b) {
+    long l;
+    l = (long)(a * b);
+  }
+};
+DontWarn2<int> DW2;
+
+// Cast is not suspicious when casting macro.
+#define A  (X<<2)
+long macro1(int X) {
+  return (long)A;
+}
+
+// Don't warn about cast in macro.
+#define B(X,Y)   (long)(X*Y)
+long macro2(int x, int y) {
+  return B(x,y);
+}
+
+void floatingpoint(float a, float b) {
+  double d = (double)(a * b); // Currently we don't warn for this.
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-move-forwarding-reference.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-move-forwarding-reference.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-move-forwarding-reference.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-move-forwarding-reference.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,125 @@
+// RUN: %check_clang_tidy -std=c++14-or-later %s bugprone-move-forwarding-reference %t -- -- -fno-delayed-template-parsing
+
+namespace std {
+template <typename> struct remove_reference;
+
+template <typename _Tp> struct remove_reference { typedef _Tp type; };
+
+template <typename _Tp> struct remove_reference<_Tp &> { typedef _Tp type; };
+
+template <typename _Tp> struct remove_reference<_Tp &&> { typedef _Tp type; };
+
+template <typename _Tp>
+constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t);
+
+} // namespace std
+
+// Standard case.
+template <typename T, typename U> void f1(U &&SomeU) {
+  T SomeT(std::move(SomeU));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+  // CHECK-FIXES: T SomeT(std::forward<U>(SomeU));
+}
+
+// Ignore parentheses around the argument to std::move().
+template <typename T, typename U> void f2(U &&SomeU) {
+  T SomeT(std::move((SomeU)));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+  // CHECK-FIXES: T SomeT(std::forward<U>((SomeU)));
+}
+
+// Handle the case correctly where std::move() is being used through a using
+// declaration.
+template <typename T, typename U> void f3(U &&SomeU) {
+  using std::move;
+  T SomeT(move(SomeU));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+  // CHECK-FIXES: T SomeT(std::forward<U>(SomeU));
+}
+
+// Handle the case correctly where a global specifier is prepended to
+// std::move().
+template <typename T, typename U> void f4(U &&SomeU) {
+  T SomeT(::std::move(SomeU));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+  // CHECK-FIXES: T SomeT(::std::forward<U>(SomeU));
+}
+
+// Create a correct fix if there are spaces around the scope resolution
+// operator.
+template <typename T, typename U> void f5(U &&SomeU) {
+  {
+    T SomeT(::  std  ::  move(SomeU));
+    // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: forwarding reference passed to
+    // CHECK-FIXES: T SomeT(::std::forward<U>(SomeU));
+  }
+  {
+    T SomeT(std  ::  move(SomeU));
+    // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: forwarding reference passed to
+    // CHECK-FIXES: T SomeT(std::forward<U>(SomeU));
+  }
+}
+
+// Ignore const rvalue reference parameters.
+template <typename T, typename U> void f6(const U &&SomeU) {
+  T SomeT(std::move(SomeU));
+}
+
+// Ignore the case where the argument to std::move() is a lambda parameter (and
+// thus not actually a parameter of the function template).
+template <typename T, typename U> void f7() {
+  [](U &&SomeU) { T SomeT(std::move(SomeU)); };
+}
+
+// Ignore the case where the argument is a lvalue reference.
+template <typename T, typename U> void f8(U &SomeU) {
+  T SomeT(std::move(SomeU));
+}
+
+// Ignore the case where the template parameter is a class template parameter
+// (i.e. no template argument deduction is taking place).
+template <typename T, typename U> class SomeClass {
+  void f(U &&SomeU) { T SomeT(std::move(SomeU)); }
+};
+
+// Ignore the case where the function parameter in the template isn't an rvalue
+// reference but the template argument is explicitly set to be an rvalue
+// reference.
+class A {};
+template <typename T> void foo(T);
+void f8() {
+  A a;
+  foo<A &&>(std::move(a));
+}
+
+// A warning is output, but no fix is suggested, if a macro is used to rename
+// std::move.
+#define MOVE(x) std::move((x))
+template <typename T, typename U> void f9(U &&SomeU) {
+  T SomeT(MOVE(SomeU));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+}
+
+// Same result if the argument is passed outside of the macro.
+#undef MOVE
+#define MOVE std::move
+template <typename T, typename U> void f10(U &&SomeU) {
+  T SomeT(MOVE(SomeU));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+}
+
+// Same result if the macro does not include the "std" namespace.
+#undef MOVE
+#define MOVE move
+template <typename T, typename U> void f11(U &&SomeU) {
+  T SomeT(std::MOVE(SomeU));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: forwarding reference passed to
+}
+
+// Handle the case correctly where the forwarding reference is a parameter of a
+// generic lambda.
+template <typename T> void f12() {
+  [] (auto&& x) { T SomeT(std::move(x)); };
+  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: forwarding reference passed to
+  // CHECK-FIXES: [] (auto&& x) { T SomeT(std::forward<decltype(x)>(x)); }
+}

Added: clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-multiple-statement-macro.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-multiple-statement-macro.cpp?rev=374540&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-multiple-statement-macro.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/checkers/bugprone-multiple-statement-macro.cpp Fri Oct 11 05:05:42 2019
@@ -0,0 +1,85 @@
+// RUN: %check_clang_tidy %s bugprone-multiple-statement-macro %t
+
+void F();
+
+#define BAD_MACRO(x) \
+  F();               \
+  F()
+
+#define GOOD_MACRO(x) \
+  do {                \
+    F();              \
+    F();              \
+  } while (0)
+
+#define GOOD_MACRO2(x) F()
+
+#define GOOD_MACRO3(x) F();
+
+#define MACRO_ARG_MACRO(X) \
+  if (54)                  \
+  X(2)
+
+#define ALL_IN_MACRO(X) \
+  if (43)               \
+    F();                \
+  F()
+
+#define GOOD_NESTED(x)   \
+  if (x)            \
+    GOOD_MACRO3(x); \
+  F();
+
+#define IF(x) if(x)
+
+void positives() {
+  if (1)
+    BAD_MACRO(1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used without braces; some statements will be unconditionally executed [bugprone-multiple-statement-macro]
+  if (1) {
+  } else
+    BAD_MACRO(1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used
+  while (1)
+    BAD_MACRO(1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used
+  for (;;)
+    BAD_MACRO(1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: multiple statement macro used
+
+  MACRO_ARG_MACRO(BAD_MACRO);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: multiple statement macro used
+  MACRO_ARG_MACRO(F(); int);
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: multiple statement macro used
+  IF(1) BAD_MACRO(1);
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: multiple statement macro used
+}
+
+void negatives() {
+  if (1) {
+    BAD_MACRO(1);
+  } else {
+    BAD_MACRO(1);
+  }
+  while (1) {
+    BAD_MACRO(1);
+  }
+  for (;;) {
+    BAD_MACRO(1);
+  }
+
+  if (1)
+    GOOD_MACRO(1);
+  if (1) {
+    GOOD_MACRO(1);
+  }
+  if (1)
+    GOOD_MACRO2(1);
+  if (1)
+    GOOD_MACRO3(1);
+
+  MACRO_ARG_MACRO(GOOD_MACRO);
+  ALL_IN_MACRO(1);
+
+  IF(1) GOOD_MACRO(1);
+}




More information about the cfe-commits mailing list