summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-unique-enum.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-05-30 20:45:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-05-30 20:45:14 +0000
commit7e6ad4627571cb1b744996f74c980d72a7ce74a4 (patch)
tree8cf6e0398dca2f90f409ea209e5f878d89662e95 /clang/test/SemaCXX/warn-unique-enum.cpp
parent177b855ed71a9cd029f6b36eadf32befa4ace9e7 (diff)
downloadbcm5719-llvm-7e6ad4627571cb1b744996f74c980d72a7ce74a4.tar.gz
bcm5719-llvm-7e6ad4627571cb1b744996f74c980d72a7ce74a4.zip
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. llvm-svn: 157713
Diffstat (limited to 'clang/test/SemaCXX/warn-unique-enum.cpp')
-rw-r--r--clang/test/SemaCXX/warn-unique-enum.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/warn-unique-enum.cpp b/clang/test/SemaCXX/warn-unique-enum.cpp
index ddafc16aab5..7d04b1dc2dd 100644
--- a/clang/test/SemaCXX/warn-unique-enum.cpp
+++ b/clang/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}}
OpenPOWER on IntegriCloud