Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index b428f4b4ce7bc68e88c2c5a44056dac89d9b1291..c2171549fea963a3ecdfb6f1286e04a20295bb5b 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -194,16 +194,11 @@ config("compiler") { |
cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] |
cflags_c += [ "-std=c99" ] |
- cflags_cc += [ "-std=gnu++11" ] |
ldflags += common_mac_flags |
} else if (is_posix) { |
# Non-Mac Posix compiler flags setup. |
# ----------------------------------- |
- if (gcc_version >= 48) { |
- cflags_cc += [ "-std=gnu++11" ] |
- } |
- |
if (enable_profiling && !is_debug) { |
# The GYP build spams this define into every compilation unit, as we do |
# here, but it only appears to be used in base and a couple other places. |
@@ -413,7 +408,18 @@ config("compiler") { |
# ------------------------------------ |
if (is_clang) { |
cflags += [ "-fcolor-diagnostics" ] |
+ } |
+ |
+ # C++11 compiler flags setup. |
+ # --------------------------- |
+ if (is_linux || is_android || is_nacl) { |
+ # gnu++11 instead of c++11 is needed because some code uses typeof() (a |
+ # GNU extension). |
+ # TODO(thakis): Eventually switch this to c++11 instead, |
+ # http://crbug.com/427584 |
cflags_cc += [ "-std=gnu++11" ] |
+ } else if (!is_win) { |
+ cflags_cc += [ "-std=c++11" ] |
} |
# Android-specific flags setup. |