diff options
author | Haojian Wu <hokein@google.com> | 2016-06-30 07:50:01 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-06-30 07:50:01 +0000 |
commit | aa6f7e6671996c85b2b8a7651c62928330f428b2 (patch) | |
tree | bf534e76f03d4d554e7e29d4fa66e02db2daf7fc /unittests/ASTMatchers/ASTMatchersNodeTest.cpp | |
parent | ce1f307b91f539c75b14cdbcd48ea0cc3218e8fb (diff) |
[ASTMatcher] Add a node matcher for EnumType.
Reviewers: aaron.ballman
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D21860
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersNodeTest.cpp')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersNodeTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/unittests/ASTMatchers/ASTMatchersNodeTest.cpp index c659c6a002..bf2c08a5aa 100644 --- a/unittests/ASTMatchers/ASTMatchersNodeTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersNodeTest.cpp @@ -1299,6 +1299,13 @@ TEST(TypeMatching, AutoRefTypes) { hasType(rValueReferenceType())))); } +TEST(TypeMatching, MatchesEnumTypes) { + EXPECT_TRUE(matches("enum Color { Green }; Color color;", + loc(enumType()))); + EXPECT_TRUE(matches("enum class Color { Green }; Color color;", + loc(enumType()))); +} + TEST(TypeMatching, MatchesPointersToConstTypes) { EXPECT_TRUE(matches("int b; int * const a = &b;", loc(pointerType()))); |