diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-05-30 20:45:14 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-05-30 20:45:14 +0000 |
commit | abe21e36d789cfe800562a1e889738addfd2ac5b (patch) | |
tree | a5fbff16c03bcbac0661cb9f3d336a897f813b8e /test/SemaCXX/warn-unique-enum.cpp | |
parent | b4a542549c2e0c9eeb6ece3f95767ccdd141fa3e (diff) |
Disable -Wunique-enum for anonymous enums.
This is a large class of false positives where anonymous enums are used to
declare constants (see Clang's Diagnostics.h for example). A small number of
true positives could probably be found in this bucket by still warning if the
anonymous enum is used in a declarator (enum { ... } x;) but so far we don't
believe this to be a source of significant benefit so I haven't bothered to
preserve those cases.
General offline review/acknowledgment by rtrieu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-unique-enum.cpp')
-rw-r--r-- | test/SemaCXX/warn-unique-enum.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/SemaCXX/warn-unique-enum.cpp b/test/SemaCXX/warn-unique-enum.cpp index ddafc16aab..7d04b1dc2d 100644 --- a/test/SemaCXX/warn-unique-enum.cpp +++ b/test/SemaCXX/warn-unique-enum.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify -Wunique-enum enum A { A1 = 1, A2 = 1, A3 = 1 }; // expected-warning {{all elements of 'A' are initialized with literals to value 1}} -enum { B1 = 1, B2 = 1, B3 = 1 }; // expected-warning {{all elements of anonymous enum are initialized with literals to value 1}} +enum { B1 = 1, B2 = 1, B3 = 1 }; // no warning enum C { C1 = true, C2 = true}; // expected-warning {{all elements of 'C' are initialized with literals to value 1}} enum D { D1 = 5, D2 = 5L, D3 = 5UL, D4 = 5LL, D5 = 5ULL }; // expected-warning {{all elements of 'D' are initialized with literals to value 5}} |