Revert of Enable noexcept on Windows, use for a few move constructors. (patchset #3 id:40001 of https://codereview.chromium.org/2771643002/ )
Reason for revert:
Seems to have broken Windows build with args.gn as:
> is_debug = true
> is_component_build = true
> enable_nacl = false
> is_chrome_branded = true
> symbol_level = 2
> target_cpu = "x86"
> is_win_fastlink = true
> is_clang = false
> win_console_app = true
> win_linker_timing = true
Original issue's description:
> Enable noexcept on Windows, use for a few move constructors.
>
> MSVC complains if you use noexcept with no exception handling mode specified (as we do).
> This code disables the warning. noexcept on move constructors allows better optimizations
> in some cases.
> http://en.cppreference.com/w/cpp/language/noexcept_spec
>
> Updates a few common classes' move constructors to use this.
>
> Review-Url: https://codereview.chromium.org/2771643002
> Cr-Commit-Position: refs/heads/master@{#458956}
> Committed: https://chromium.googlesource.com/chromium/src/+/76aac97386e2788241161420c5e7e0bfee16f88c
TBR=brucedawson@chromium.org,lfg@chromium.org,brettw@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/2769703007
Cr-Commit-Position: refs/heads/master@{#459101}
diff --git a/base/android/jni_weak_ref.cc b/base/android/jni_weak_ref.cc
index 88efa72..fe7ea2e 100644
--- a/base/android/jni_weak_ref.cc
+++ b/base/android/jni_weak_ref.cc
@@ -19,8 +19,7 @@
Assign(orig);
}
-JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(
- JavaObjectWeakGlobalRef&& orig) noexcept
+JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(JavaObjectWeakGlobalRef&& orig)
: obj_(orig.obj_) {
orig.obj_ = nullptr;
}
diff --git a/base/android/jni_weak_ref.h b/base/android/jni_weak_ref.h
index 43a26b5f..223c47b 100644
--- a/base/android/jni_weak_ref.h
+++ b/base/android/jni_weak_ref.h
@@ -18,7 +18,7 @@
public:
JavaObjectWeakGlobalRef();
JavaObjectWeakGlobalRef(const JavaObjectWeakGlobalRef& orig);
- JavaObjectWeakGlobalRef(JavaObjectWeakGlobalRef&& orig) noexcept;
+ JavaObjectWeakGlobalRef(JavaObjectWeakGlobalRef&& orig);
JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj);
JavaObjectWeakGlobalRef(JNIEnv* env,
const base::android::JavaRef<jobject>& obj);
diff --git a/base/values.cc b/base/values.cc
index 7ae3b63..fef999c 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -91,7 +91,7 @@
InternalCopyConstructFrom(that);
}
-Value::Value(Value&& that) noexcept {
+Value::Value(Value&& that) {
InternalMoveConstructFrom(std::move(that));
}
diff --git a/base/values.h b/base/values.h
index f74f543..b7ca355 100644
--- a/base/values.h
+++ b/base/values.h
@@ -74,7 +74,7 @@
size_t size);
Value(const Value& that);
- Value(Value&& that) noexcept;
+ Value(Value&& that);
Value(); // A null value.
explicit Value(Type type);
explicit Value(bool in_bool);
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 3fb6c90..0419926d 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -303,11 +303,17 @@
# ---------------------------------
if (is_linux || is_android) {
if (use_pic) {
- cflags += [ "-fPIC" ]
- ldflags += [ "-fPIC" ]
+ cflags += [
+ "-fPIC",
+ ]
+ ldflags += [
+ "-fPIC",
+ ]
}
- cflags += [ "-pipe" ] # Use pipes for communicating between sub-processes. Faster.
+ cflags += [
+ "-pipe", # Use pipes for communicating between sub-processes. Faster.
+ ]
ldflags += [
"-Wl,-z,noexecstack",
@@ -899,10 +905,6 @@
# This is necessary for the shared library build.
"/wd4251",
- # C4312 is a VS 2015 64-bit warning for integer to larger pointer.
- # TODO(brucedawson): fix warnings, crbug.com/554200
- "/wd4312",
-
# C4351: new behavior: elements of array 'array' will be default
# initialized
# This is a silly "warning" that basically just alerts you that the
@@ -965,10 +967,10 @@
"/wd4459",
]
- cflags_cc += [
- # Allow "noexcept" annotations even though we compile with exceptions
- # disabled.
- "/wd4577",
+ cflags += [
+ # C4312 is a VS 2015 64-bit warning for integer to larger pointer.
+ # TODO(brucedawson): fix warnings, crbug.com/554200
+ "/wd4312",
]
if (current_cpu == "x86") {
diff --git a/tools/gn/value.cc b/tools/gn/value.cc
index 0afbc7d..b5e21f0 100644
--- a/tools/gn/value.cc
+++ b/tools/gn/value.cc
@@ -73,7 +73,7 @@
scope_value_ = other.scope_value_->MakeClosure();
}
-Value::Value(Value&& other) noexcept = default;
+Value::Value(Value&& other) = default;
Value::~Value() {
}
diff --git a/tools/gn/value.h b/tools/gn/value.h
index 3ce0117f..0428818e 100644
--- a/tools/gn/value.h
+++ b/tools/gn/value.h
@@ -43,7 +43,7 @@
Value(const ParseNode* origin, std::unique_ptr<Scope> scope);
Value(const Value& other);
- Value(Value&& other) noexcept;
+ Value(Value&& other);
~Value();
Value& operator=(const Value& other);
diff --git a/url/gurl.cc b/url/gurl.cc
index 1fe48db3..09ab212c 100644
--- a/url/gurl.cc
+++ b/url/gurl.cc
@@ -79,7 +79,7 @@
DCHECK(!is_valid_ || !SchemeIsFileSystem() || inner_url_);
}
-GURL::GURL(GURL&& other) noexcept
+GURL::GURL(GURL&& other)
: spec_(std::move(other.spec_)),
is_valid_(other.is_valid_),
parsed_(other.parsed_),
diff --git a/url/gurl.h b/url/gurl.h
index 74efbb5..4cbd8465 100644
--- a/url/gurl.h
+++ b/url/gurl.h
@@ -54,7 +54,7 @@
// Copy construction is relatively inexpensive, with most of the time going
// to reallocating the string. It does not re-parse.
GURL(const GURL& other);
- GURL(GURL&& other) noexcept;
+ GURL(GURL&& other);
// The strings to this contructor should be UTF-8 / UTF-16.
explicit GURL(base::StringPiece url_string);