Repository: dtolnay/cxx (language: rust)

Issue:
bazel rust_cxx_bridge still uses c++11 in compilation
I wrote an inline function in the c++ header file `lib.h` and used `include!("src/lib.h")`:
```c++
inline std::unique_ptr<Wrapper> create_setter() {
  return std::make_unique<Wrapper>();
}
```

And then I found the option `-std=c++0x` shown in the following error occurred in compilation:
```
BUILD:24:16: Compiling src/lib.rs.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 21 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from bazel-out/k8-fastbuild/bin/src/lib.rs.cc:1:
./src/lib.h: In function 'std::unique_ptr<Wrapper> create_setter()':
./src/lib.h:28:15: error: 'make_unique' is not a member of 'std'
   28 |   return std::make_unique<Wrapper>();
```

Please consider to add an argument in `rust_cxx_bridge` to specify the c++ standards.


Discussion / hints:
Ok. This can be solved by using `bazel build ... --cxxopt='-std=c++17'`

Fix patch:
diff --git a/.bazelrc b/.bazelrc
index 5e3ff76a0..f6ec1aba3 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,2 +1,4 @@
 build --enable_platform_specific_config
 build:linux --@rules_rust//:extra_rustc_flags=-Clink-arg=-fuse-ld=lld
+build:linux --cxxopt=-std=c++17
+build:macos --cxxopt=-std=c++17
diff --git a/demo/BUILD b/demo/BUILD
index 5c277ad36..3de1cce88 100644
--- a/demo/BUILD
+++ b/demo/BUILD
@@ -22,7 +22,6 @@ rust_cxx_bridge(
 cc_library(
     name = "blobstore-sys",
     srcs = ["src/blobstore.cc"],
-    copts = ["-std=c++14"],
     deps = [
         ":blobstore-include",
         ":bridge/include",


Test patch: