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

Side by Side Diff: base/compiler_specific.h

Issue 14472011: Update ALLOW_THIS_IN_INITIALIZER_LIST macro to reflect its deprecatation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
« no previous file with comments | « no previous file | build/common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_COMPILER_SPECIFIC_H_ 5 #ifndef BASE_COMPILER_SPECIFIC_H_
6 #define BASE_COMPILER_SPECIFIC_H_ 6 #define BASE_COMPILER_SPECIFIC_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(COMPILER_MSVC) 10 #if defined(COMPILER_MSVC)
(...skipping 22 matching lines...) Expand all
33 // remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all 33 // remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
34 // warnings. 34 // warnings.
35 #define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n)) 35 #define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n))
36 36
37 // Pop effects of innermost MSVC_PUSH_* macro. 37 // Pop effects of innermost MSVC_PUSH_* macro.
38 #define MSVC_POP_WARNING() __pragma(warning(pop)) 38 #define MSVC_POP_WARNING() __pragma(warning(pop))
39 39
40 #define MSVC_DISABLE_OPTIMIZE() __pragma(optimize("", off)) 40 #define MSVC_DISABLE_OPTIMIZE() __pragma(optimize("", off))
41 #define MSVC_ENABLE_OPTIMIZE() __pragma(optimize("", on)) 41 #define MSVC_ENABLE_OPTIMIZE() __pragma(optimize("", on))
42 42
43 // Allows |this| to be passed as an argument in constructor initializer lists. 43 // DEPRECATED
44 // This uses push/pop instead of the seemingly simpler suppress feature to avoid
45 // having the warning be disabled for more than just |code|.
46 // 44 //
47 // Example usage: 45 // Prior to r83840 this was used to supress warning C4355 when using |this| as
48 // Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {} 46 // an argument in constructor initializer lists:
47 // http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
49 // 48 //
50 // Compiler warning C4355: 'this': used in base member initializer list: 49 // C4355 is supressed globally during compilation and existing uses of this
51 // http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx 50 // macro should be removed. Refer to http://crbug.com/234765 for details.
52 #define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \ 51 #define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
53 code \
54 MSVC_POP_WARNING()
55 52
56 // Allows exporting a class that inherits from a non-exported base class. 53 // Allows exporting a class that inherits from a non-exported base class.
57 // This uses suppress instead of push/pop because the delimiter after the 54 // This uses suppress instead of push/pop because the delimiter after the
58 // declaration (either "," or "{") has to be placed before the pop macro. 55 // declaration (either "," or "{") has to be placed before the pop macro.
59 // 56 //
60 // Example usage: 57 // Example usage:
61 // class EXPORT_API Foo : NON_EXPORTED_BASE(public Bar) { 58 // class EXPORT_API Foo : NON_EXPORTED_BASE(public Bar) {
62 // 59 //
63 // MSVC Compiler warning C4275: 60 // MSVC Compiler warning C4275:
64 // non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. 61 // non dll-interface class 'Bar' used as base for dll-interface class 'Foo'.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 172
176 // Mark a memory region fully initialized. 173 // Mark a memory region fully initialized.
177 // Use this to annotate code that deliberately reads uninitialized data, for 174 // Use this to annotate code that deliberately reads uninitialized data, for
178 // example a GC scavenging root set pointers from the stack. 175 // example a GC scavenging root set pointers from the stack.
179 #define MSAN_UNPOISON(p, s) __msan_unpoison(p, s) 176 #define MSAN_UNPOISON(p, s) __msan_unpoison(p, s)
180 #else // MEMORY_SANITIZER 177 #else // MEMORY_SANITIZER
181 #define MSAN_UNPOISON(p, s) 178 #define MSAN_UNPOISON(p, s)
182 #endif // MEMORY_SANITIZER 179 #endif // MEMORY_SANITIZER
183 180
184 #endif // BASE_COMPILER_SPECIFIC_H_ 181 #endif // BASE_COMPILER_SPECIFIC_H_
OLDNEW
« no previous file with comments | « no previous file | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698