summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-26 08:12:00 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-26 08:12:00 +0000
commit7815a361a27eb90fa33ba42b92faeb5e991897f3 (patch)
treeb10d186b900fb53e304d4e81b956968f48a150ae
parent6f8dc9f5327c1242dc0c7f87a45a59904faacce4 (diff)
downloadchromium_src-7815a361a27eb90fa33ba42b92faeb5e991897f3.zip
chromium_src-7815a361a27eb90fa33ba42b92faeb5e991897f3.tar.gz
chromium_src-7815a361a27eb90fa33ba42b92faeb5e991897f3.tar.bz2
Update ALLOW_THIS_IN_INITIALIZER_LIST macro to reflect its deprecatation.
In addition move C4355 to list of sanctioned compiler warning suppressions. The warning was disabled globally for ~2 years, meaning the macro wasn't providing any value. Refer to bug and chromium-dev@ discussion for details. BUG=234765 Review URL: https://chromiumcodereview.appspot.com/14472011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196671 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/compiler_specific.h17
-rw-r--r--build/common.gypi6
2 files changed, 10 insertions, 13 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 01c1eb1..5291ee5 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -40,18 +40,15 @@
#define MSVC_DISABLE_OPTIMIZE() __pragma(optimize("", off))
#define MSVC_ENABLE_OPTIMIZE() __pragma(optimize("", on))
-// Allows |this| to be passed as an argument in constructor initializer lists.
-// This uses push/pop instead of the seemingly simpler suppress feature to avoid
-// having the warning be disabled for more than just |code|.
+// DEPRECATED
//
-// Example usage:
-// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {}
-//
-// Compiler warning C4355: 'this': used in base member initializer list:
+// Prior to r83840 this was used to supress warning C4355 when using |this| as
+// an argument in constructor initializer lists:
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
-#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
- code \
- MSVC_POP_WARNING()
+//
+// C4355 is supressed globally during compilation and existing uses of this
+// macro should be removed. Refer to http://crbug.com/234765 for details.
+#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
// Allows exporting a class that inherits from a non-exported base class.
// This uses suppress instead of push/pop because the delimiter after the
diff --git a/build/common.gypi b/build/common.gypi
index fa829b3..795231a 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -4053,12 +4053,12 @@
'$(VSInstallDir)/VC/atlmfc/include',
],
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
- 'msvs_disabled_warnings': [4351, 4396, 4503, 4819,
+ 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819,
# TODO(maruel): These warnings are level 4. They will be slowly
# removed as code is fixed.
4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
- 4310, 4355, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701,
- 4702, 4706,
+ 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4702,
+ 4706,
],
'msvs_settings': {
'VCCLCompilerTool': {