Skip to content

Commit

Permalink
[analyzer][NFC] Minor cleanup in two test files. (#100570)
Browse files Browse the repository at this point in the history
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.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250625
  • Loading branch information
NagyDonat authored and yuxuanchen1997 committed Jul 25, 2024
1 parent f412fdd commit 43f9ee4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions clang/test/Analysis/ctor-array.cpp
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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];
Expand Down
2 changes: 0 additions & 2 deletions clang/test/Analysis/ctor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ void testNonPODCopyConstructor() {
namespace ConstructorVirtualCalls {
class A {
public:
int *out1, *out2, *out3;

virtual int get() { return 1; }

A(int *out1) {
Expand Down

0 comments on commit 43f9ee4

Please sign in to comment.