Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: tools/clang/plugins/tests/enum_last_value_from_c.c

Issue 213403010: Re-enable the clang check for enum constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Default to "off", add C-style enum test. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // We warn when xxxLAST constants aren't last.
6 enum BadOne {
7 kBadOneInvalid = -1,
8 kBadOneRed,
9 kBadOneGreen,
10 kBadOneBlue,
11 kBadOneLast = kBadOneGreen
12 };
13
14 // We don't handle this case when called from C due to sign mismatch issues.
15 // No matter; we're not looking for this issue outside of C++.
16 enum FailOne {
17 FAIL_ONE_INVALID,
18 FAIL_ONE_RED,
19 FAIL_ONE_GREEN,
20 FAIL_ONE_BLUE = 0xfffffffc,
21 FAIL_ONE_LAST = FAIL_ONE_GREEN
22 };
23
24 // We dont warn when xxxLAST constants are last.
Nico 2014/03/28 03:31:51 don't
25 enum GoodOne {
26 kGoodOneInvalid = -1,
27 kGoodOneRed,
28 kGoodOneGreen,
29 kGoodOneBlue,
30 kGoodOneLast = kGoodOneBlue
31 };
32
33 // We dont warn when xxx_LAST constants are last.
Nico 2014/03/28 03:31:51 don't
34 enum GoodTwo {
35 GOOD_TWO_INVALID,
36 GOOD_TWO_RED,
37 GOOD_TWO_GREEN,
38 GOOD_TWO_BLUE = 0xfffffffc,
39 GOOD_TWO_LAST = GOOD_TWO_BLUE
40 };
OLDNEW
« no previous file with comments | « tools/clang/plugins/tests/enum_last_value.txt ('k') | tools/clang/plugins/tests/enum_last_value_from_c.flags » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698