diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-10-23 23:59:08 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-10-23 23:59:08 +0000 |
commit | 603513d2294c437b37bcf47f326b686e31bd9e84 (patch) | |
tree | 0f096b6471977648335ed23ba35eeb7c9b352e6f /test/Analysis/member-expr.cpp | |
parent | 4d9e497a2b1eab3b1214848216050c64fc3acfd6 (diff) |
[analyzer] Handle 'SomeVar.SomeEnumConstant', which is legal in C++.
This caused assertion failures analyzing LLVM.
<rdar://problem/12560282>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/member-expr.cpp')
-rw-r--r-- | test/Analysis/member-expr.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/member-expr.cpp b/test/Analysis/member-expr.cpp new file mode 100644 index 0000000000..cf437387d6 --- /dev/null +++ b/test/Analysis/member-expr.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -verify + +void clang_analyzer_eval(int); + +namespace EnumsViaMemberExpr { + struct Foo { + enum E { + Bar = 1 + }; + }; + + void testEnumVal(Foo Baz) { + clang_analyzer_eval(Baz.Bar == Foo::Bar); // expected-warning{{TRUE}} + } + + void testEnumRef(Foo &Baz) { + clang_analyzer_eval(Baz.Bar == Foo::Bar); // expected-warning{{TRUE}} + } + + void testEnumPtr(Foo *Baz) { + clang_analyzer_eval(Baz->Bar == Foo::Bar); // expected-warning{{TRUE}} + } +}
\ No newline at end of file |