diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2019-05-14 21:58:59 +0000 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2019-05-14 21:58:59 +0000 |
commit | b35a2aa71f76a334a9c98c0a3c3995b5d902d2b9 (patch) | |
tree | cdff4a5d1a715d4ad622fd8f190128b54bebe440 /test/Analysis/initializer.cpp | |
parent | 3748d41833787fcbf59cc5624e8d2b042a8991bc (diff) | |
parent | 741e05796da92b46d4f7bcbee00702ff37df6489 (diff) |
Creating branches/google/stable and tags/google/stable/2019-05-14 from r360103upstream/google/stable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/google/stable@360714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/initializer.cpp')
-rw-r--r-- | test/Analysis/initializer.cpp | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/test/Analysis/initializer.cpp b/test/Analysis/initializer.cpp index 0cb68c4a97..56b0a09d47 100644 --- a/test/Analysis/initializer.cpp +++ b/test/Analysis/initializer.cpp @@ -1,7 +1,17 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks,debug.ExprInspection -analyzer-config c++-inlining=constructors -std=c++11 -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks,debug.ExprInspection -analyzer-config c++-inlining=constructors -std=c++17 -DCPLUSPLUS17 -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks,debug.ExprInspection -analyzer-config c++-inlining=constructors -std=c++11 -DTEST_INLINABLE_ALLOCATORS -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks,debug.ExprInspection -analyzer-config c++-inlining=constructors -std=c++17 -DCPLUSPLUS17 -DTEST_INLINABLE_ALLOCATORS -verify %s +// RUN: %clang_analyze_cc1 -w -verify %s\ +// RUN: -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks\ +// RUN: -analyzer-checker=debug.ExprInspection -std=c++11 +// RUN: %clang_analyze_cc1 -w -verify %s\ +// RUN: -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks\ +// RUN: -analyzer-checker=debug.ExprInspection -std=c++17 +// RUN: %clang_analyze_cc1 -w -verify %s\ +// RUN: -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks\ +// RUN: -analyzer-checker=debug.ExprInspection -std=c++11\ +// RUN: -DTEST_INLINABLE_ALLOCATORS +// RUN: %clang_analyze_cc1 -w -verify %s\ +// RUN: -analyzer-checker=core,unix.Malloc,cplusplus.NewDeleteLeaks\ +// RUN: -analyzer-checker=debug.ExprInspection -std=c++17\ +// RUN: -DTEST_INLINABLE_ALLOCATORS void clang_analyzer_eval(bool); @@ -232,7 +242,7 @@ void foo() { D d = {}; // no-crash -#ifdef CPLUSPLUS17 +#if __cplusplus >= 201703L C cd = {{}}; // no-crash const C &cdl = {{}}; // no-crash C &&cdr = {{}}; // no-crash @@ -242,4 +252,26 @@ void foo() { B &&bcr = C({{}}); // no-crash #endif } +} // namespace CXX17_aggregate_construction + +namespace CXX17_transparent_init_list_exprs { +class A {}; + +class B: private A {}; + +B boo(); +void foo1() { + B b { boo() }; // no-crash +} + +class C: virtual public A {}; + +C coo(); +void foo2() { + C c { coo() }; // no-crash +} + +B foo_recursive() { + B b { foo_recursive() }; } +} // namespace CXX17_transparent_init_list_exprs |