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 warn when xxx_LAST constants aren't last. 15 enum BadTwo : unsigned { 16 BAD_TWO_INVALID, 17 BAD_TWO_RED, 18 BAD_TWO_GREEN, 19 BAD_TWO_BLUE = 0xfffffffc, 20 BAD_TWO_LAST = BAD_TWO_GREEN 21 }; 22 23 // We don't warn when xxxLAST constants are last. 24 enum GoodOne { 25 kGoodOneInvalid = -1, 26 kGoodOneRed, 27 kGoodOneGreen, 28 kGoodOneBlue, 29 kGoodOneLast = kGoodOneBlue 30 }; 31 32 // We don't warn when xxx_LAST constants are last. 33 enum GoodTwo : unsigned { 34 GOOD_TWO_INVALID, 35 GOOD_TWO_RED, 36 GOOD_TWO_GREEN, 37 GOOD_TWO_BLUE = 0xfffffffc, 38 GOOD_TWO_LAST = GOOD_TWO_BLUE 39 }; 40