diff options
Diffstat (limited to 'clang-tidy/misc')
27 files changed, 87 insertions, 113 deletions
diff --git a/clang-tidy/misc/DefinitionsInHeadersCheck.cpp b/clang-tidy/misc/DefinitionsInHeadersCheck.cpp index f4dab397..a36f307b 100644 --- a/clang-tidy/misc/DefinitionsInHeadersCheck.cpp +++ b/clang-tidy/misc/DefinitionsInHeadersCheck.cpp @@ -1,9 +1,8 @@ //===--- DefinitionsInHeadersCheck.cpp - clang-tidy------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/DefinitionsInHeadersCheck.h b/clang-tidy/misc/DefinitionsInHeadersCheck.h index 428b05cd..8e5eb7c8 100644 --- a/clang-tidy/misc/DefinitionsInHeadersCheck.h +++ b/clang-tidy/misc/DefinitionsInHeadersCheck.h @@ -1,9 +1,8 @@ //===--- DefinitionsInHeadersCheck.h - clang-tidy----------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/MiscTidyModule.cpp b/clang-tidy/misc/MiscTidyModule.cpp index dd9061a4..ba160d1d 100644 --- a/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tidy/misc/MiscTidyModule.cpp @@ -1,9 +1,8 @@ //===--- MiscTidyModule.cpp - clang-tidy ----------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/MisplacedConstCheck.cpp b/clang-tidy/misc/MisplacedConstCheck.cpp index 515b22c0..1e1b2b0d 100644 --- a/clang-tidy/misc/MisplacedConstCheck.cpp +++ b/clang-tidy/misc/MisplacedConstCheck.cpp @@ -1,9 +1,8 @@ //===--- MisplacedConstCheck.cpp - clang-tidy------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/MisplacedConstCheck.h b/clang-tidy/misc/MisplacedConstCheck.h index 410edf7b..a156e3e3 100644 --- a/clang-tidy/misc/MisplacedConstCheck.h +++ b/clang-tidy/misc/MisplacedConstCheck.h @@ -1,9 +1,8 @@ //===--- MisplacedConstCheck.h - clang-tidy----------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/NewDeleteOverloadsCheck.cpp b/clang-tidy/misc/NewDeleteOverloadsCheck.cpp index 5e291195..a96d1904 100644 --- a/clang-tidy/misc/NewDeleteOverloadsCheck.cpp +++ b/clang-tidy/misc/NewDeleteOverloadsCheck.cpp @@ -1,9 +1,8 @@ //===--- NewDeleteOverloadsCheck.cpp - clang-tidy--------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/NewDeleteOverloadsCheck.h b/clang-tidy/misc/NewDeleteOverloadsCheck.h index 3e99892b..46a3bb72 100644 --- a/clang-tidy/misc/NewDeleteOverloadsCheck.h +++ b/clang-tidy/misc/NewDeleteOverloadsCheck.h @@ -1,9 +1,8 @@ //===--- NewDeleteOverloadsCheck.h - clang-tidy----------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/NonCopyableObjects.cpp b/clang-tidy/misc/NonCopyableObjects.cpp index de152754..53cc2734 100644 --- a/clang-tidy/misc/NonCopyableObjects.cpp +++ b/clang-tidy/misc/NonCopyableObjects.cpp @@ -1,9 +1,8 @@ //===--- NonCopyableObjects.cpp - clang-tidy-------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/NonCopyableObjects.h b/clang-tidy/misc/NonCopyableObjects.h index 38a45fd5..5ebaba83 100644 --- a/clang-tidy/misc/NonCopyableObjects.h +++ b/clang-tidy/misc/NonCopyableObjects.h @@ -1,9 +1,8 @@ //===--- NonCopyableObjects.h - clang-tidy-----------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp b/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp index c0bdbfbf..7f57fecd 100644 --- a/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp +++ b/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp @@ -1,9 +1,8 @@ //===--- NonPrivateMemberVariablesInClassesCheck.cpp - clang-tidy ---------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -23,8 +22,8 @@ AST_MATCHER(CXXRecordDecl, hasMethods) { return std::distance(Node.method_begin(), Node.method_end()) != 0; } -AST_MATCHER(CXXRecordDecl, hasNonStaticMethod) { - return hasMethod(unless(isStaticStorageClass())) +AST_MATCHER(CXXRecordDecl, hasNonStaticNonImplicitMethod) { + return hasMethod(unless(anyOf(isStaticStorageClass(), isImplicit()))) .matches(Node, Finder, Builder); } @@ -67,10 +66,11 @@ void NonPrivateMemberVariablesInClassesCheck::registerMatchers( IgnorePublicMemberVariables ? isProtected() : unless(isPrivate())); // We only want the records that not only contain the mutable data (non-static - // member variables), but also have some logic (non-static member functions). - // We may optionally ignore records where all the member variables are public. + // member variables), but also have some logic (non-static, non-implicit + // member functions). We may optionally ignore records where all the member + // variables are public. Finder->addMatcher(cxxRecordDecl(anyOf(isStruct(), isClass()), hasMethods(), - hasNonStaticMethod(), + hasNonStaticNonImplicitMethod(), unless(ShouldIgnoreRecord), forEach(InterestingField.bind("field"))) .bind("record"), diff --git a/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h b/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h index c39e356c..6072eae8 100644 --- a/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h +++ b/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h @@ -1,9 +1,8 @@ //===--- NonPrivateMemberVariablesInClassesCheck.h - clang-tidy -*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/RedundantExpressionCheck.cpp b/clang-tidy/misc/RedundantExpressionCheck.cpp index e9b0f4d0..33a8b9a4 100644 --- a/clang-tidy/misc/RedundantExpressionCheck.cpp +++ b/clang-tidy/misc/RedundantExpressionCheck.cpp @@ -1,9 +1,8 @@ //===--- RedundantExpressionCheck.cpp - clang-tidy-------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/RedundantExpressionCheck.h b/clang-tidy/misc/RedundantExpressionCheck.h index c0f8bf5e..02d37e16 100644 --- a/clang-tidy/misc/RedundantExpressionCheck.h +++ b/clang-tidy/misc/RedundantExpressionCheck.h @@ -1,9 +1,8 @@ //===--- RedundantExpressionCheck.h - clang-tidy-----------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/StaticAssertCheck.cpp b/clang-tidy/misc/StaticAssertCheck.cpp index 583ed7ad..18d94128 100644 --- a/clang-tidy/misc/StaticAssertCheck.cpp +++ b/clang-tidy/misc/StaticAssertCheck.cpp @@ -1,9 +1,8 @@ //===--- StaticAssertCheck.cpp - clang-tidy -------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/StaticAssertCheck.h b/clang-tidy/misc/StaticAssertCheck.h index faefce17..f3d3586e 100644 --- a/clang-tidy/misc/StaticAssertCheck.h +++ b/clang-tidy/misc/StaticAssertCheck.h @@ -1,9 +1,8 @@ //===--- StaticAssertCheck.h - clang-tidy -----------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp b/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp index 759c3f0e..b7077a12 100644 --- a/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp +++ b/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp @@ -1,9 +1,8 @@ //===--- ThrowByValueCatchByReferenceCheck.cpp - clang-tidy----------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h b/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h index a2e7df73..6b79c20f 100644 --- a/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h +++ b/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h @@ -1,9 +1,8 @@ //===--- ThrowByValueCatchByReferenceCheck.h - clang-tidy--------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp b/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp index 84dd410d..8c87dae9 100644 --- a/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp +++ b/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp @@ -1,9 +1,8 @@ //===--- UnconventionalAssignOperatorCheck.cpp - clang-tidy -----*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnconventionalAssignOperatorCheck.h b/clang-tidy/misc/UnconventionalAssignOperatorCheck.h index ee91dcaa..761701df 100644 --- a/clang-tidy/misc/UnconventionalAssignOperatorCheck.h +++ b/clang-tidy/misc/UnconventionalAssignOperatorCheck.h @@ -1,9 +1,8 @@ //===--- UnconventionalAssignOperatorCheck.h - clang-tidy -------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp b/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp index 99758d33..9363fa90 100644 --- a/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp +++ b/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp @@ -1,9 +1,8 @@ //===--- UniqueptrResetReleaseCheck.cpp - clang-tidy ----------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UniqueptrResetReleaseCheck.h b/clang-tidy/misc/UniqueptrResetReleaseCheck.h index cf18a5a5..d013f32c 100644 --- a/clang-tidy/misc/UniqueptrResetReleaseCheck.h +++ b/clang-tidy/misc/UniqueptrResetReleaseCheck.h @@ -1,9 +1,8 @@ //===--- UniqueptrResetReleaseCheck.h - clang-tidy --------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tidy/misc/UnusedAliasDeclsCheck.cpp index 4beb4320..c301aeab 100644 --- a/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ b/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -1,9 +1,8 @@ //===--- UnusedAliasDeclsCheck.cpp - clang-tidy----------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnusedAliasDeclsCheck.h b/clang-tidy/misc/UnusedAliasDeclsCheck.h index 8cce3756..af27ef0f 100644 --- a/clang-tidy/misc/UnusedAliasDeclsCheck.h +++ b/clang-tidy/misc/UnusedAliasDeclsCheck.h @@ -1,9 +1,8 @@ //===--- UnusedAliasDeclsCheck.h - clang-tidy--------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tidy/misc/UnusedParametersCheck.cpp index cee09150..01dce8fa 100644 --- a/clang-tidy/misc/UnusedParametersCheck.cpp +++ b/clang-tidy/misc/UnusedParametersCheck.cpp @@ -1,9 +1,8 @@ //===--- UnusedParametersCheck.cpp - clang-tidy----------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnusedParametersCheck.h b/clang-tidy/misc/UnusedParametersCheck.h index b9bae26f..f4e07083 100644 --- a/clang-tidy/misc/UnusedParametersCheck.h +++ b/clang-tidy/misc/UnusedParametersCheck.h @@ -1,9 +1,8 @@ //===--- UnusedParametersCheck.h - clang-tidy--------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnusedUsingDeclsCheck.cpp b/clang-tidy/misc/UnusedUsingDeclsCheck.cpp index 48009b5a..532dbfd4 100644 --- a/clang-tidy/misc/UnusedUsingDeclsCheck.cpp +++ b/clang-tidy/misc/UnusedUsingDeclsCheck.cpp @@ -1,9 +1,8 @@ //===--- UnusedUsingDeclsCheck.cpp - clang-tidy----------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/clang-tidy/misc/UnusedUsingDeclsCheck.h b/clang-tidy/misc/UnusedUsingDeclsCheck.h index 2a41a8f6..acc6a44e 100644 --- a/clang-tidy/misc/UnusedUsingDeclsCheck.h +++ b/clang-tidy/misc/UnusedUsingDeclsCheck.h @@ -1,9 +1,8 @@ //===--- UnusedUsingDeclsCheck.h - clang-tidy--------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// |