llvm-project/clang/test/Analysis/cxx-inherited-ctor-is-skipped-as-top-level.cpp
Gabor Marton 59a960b83c [analyzer] Skip analysis of inherited ctor as top-level function
Summary:
This fixes a regression introduced in https://reviews.llvm.org/D74735

Reviewers: NoQ, Szelethus

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75678
2020-03-09 12:05:11 +01:00

21 lines
485 B
C++

// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-display-progress %s 2>&1 | FileCheck %s
// Test that inheriting constructors are not analyzed as top-level functions.
// CHECK: ANALYZE (Path, Inline_Regular): {{.*}} c()
// CHECK: ANALYZE (Path, Inline_Regular): {{.*}} a::a(int)
// CHECK-NOT: ANALYZE (Path, Inline_Regular): {{.*}} b::a(int)
class a {
public:
a(int) {}
};
struct b : a {
using a::a; // Ihnerited ctor.
};
void c() {
int d;
(b(d));
(a(d));
}