[clang] [analyzer][NFC] Minor cleanup in two test files. (PR #100570)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 25 06:55:22 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: DonĂ¡t Nagy (NagyDonat)
<details>
<summary>Changes</summary>
This commit contains two unrelated trivial changes:
(1) Three unused variables are removed from `ctor.mm`.
(2) A FIXME block is removed from `ctor-array.cpp` because it described
an issue that was resolved since then.
---
Full diff: https://github.com/llvm/llvm-project/pull/100570.diff
2 Files Affected:
- (modified) clang/test/Analysis/ctor-array.cpp (+1-11)
- (modified) clang/test/Analysis/ctor.mm (-2)
``````````diff
diff --git a/clang/test/Analysis/ctor-array.cpp b/clang/test/Analysis/ctor-array.cpp
index 053669cc2aada..49412ee5a68c7 100644
--- a/clang/test/Analysis/ctor-array.cpp
+++ b/clang/test/Analysis/ctor-array.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-disable-checker=cplusplus -analyzer-config c++-inlining=constructors -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-inlining=constructors -verify %s
#include "Inputs/system-header-simulator-cxx.h"
@@ -119,16 +119,6 @@ struct s5 {
};
void g1(void) {
- // FIXME: This test requires -analyzer-disable-checker=cplusplus,
- // because of the checker's weird behaviour in case of arrays.
- // E.g.:
- // s3 *arr = new s3[4];
- // s3 *arr2 = new (arr + 1) s3[1];
- // ^~~~~~~~~~~~~~~~~~~
- // warning: 12 bytes is possibly not enough
- // for array allocation which requires
- // 4 bytes.
-
s5::c = 0;
s5 *arr = new s5[4];
new (arr + 1) s5[3];
diff --git a/clang/test/Analysis/ctor.mm b/clang/test/Analysis/ctor.mm
index fb385833df9c7..6ac9050fc29f7 100644
--- a/clang/test/Analysis/ctor.mm
+++ b/clang/test/Analysis/ctor.mm
@@ -56,8 +56,6 @@ void testNonPODCopyConstructor() {
namespace ConstructorVirtualCalls {
class A {
public:
- int *out1, *out2, *out3;
-
virtual int get() { return 1; }
A(int *out1) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/100570
More information about the cfe-commits
mailing list