summaryrefslogtreecommitdiff
path: root/test/Analysis/initializer.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
commit486754660bb926339aefcf012a3f848592babb8b (patch)
treeecdbc446c9876f4f120f701c243373cd3cb43db3 /test/Analysis/initializer.cpp
parent55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff)
Notes
Diffstat (limited to 'test/Analysis/initializer.cpp')
-rw-r--r--test/Analysis/initializer.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/test/Analysis/initializer.cpp b/test/Analysis/initializer.cpp
index 55f0a8950287a..0cb68c4a9780e 100644
--- a/test/Analysis/initializer.cpp
+++ b/test/Analysis/initializer.cpp
@@ -1,5 +1,7 @@
// 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
void clang_analyzer_eval(bool);
@@ -176,29 +178,6 @@ namespace ReferenceInitialization {
const MyStruct &myStruct(OtherStruct(5));
myStruct.method(); // no-warning
}
-
- struct HasMyStruct {
- const MyStruct &ms; // expected-note {{reference member declared here}}
- const MyStruct &msWithCleanups; // expected-note {{reference member declared here}}
-
- // clang's Sema issues a warning when binding a reference member to a
- // temporary value.
- HasMyStruct() : ms(5), msWithCleanups(OtherStruct(5)) {
- // expected-warning@-1 {{binding reference member 'ms' to a temporary value}}
- // expected-warning@-2 {{binding reference member 'msWithCleanups' to a temporary value}}
-
- // At this point the members are not garbage so we should not expect an
- // analyzer warning here even though binding a reference member
- // to a member is a terrible idea.
- ms.method(); // no-warning
- msWithCleanups.method(); // no-warning
- }
- };
-
- void referenceInitializeField() {
- HasMyStruct hms;
- }
-
};
namespace PR31592 {