diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2c0b759..abb213ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,13 @@ permissions: contents: read jobs: + # These jobs are legacy but needed for CopyBara to pass tests. ubuntu-latest-cpp17: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: test - run: bazel query --output=label 'kind("...", //...) except attr("tags", "cpp20", "//...")' | xargs bazel test --cxxopt='-Werror' --cxxopt='-std=c++17' --repo_env=CC=clang --test_output=errors + run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++17' --repo_env=CC=clang --test_output=errors //implementation/legacy/... ubuntu-latest-cpp20: runs-on: ubuntu-latest @@ -29,7 +30,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: test - run: bazel query --output=label 'kind("...", //...) except attr(tags, "cpp20", //...)' | xargs bazel test --cxxopt='-Werror' --cxxopt='-std=c++17' --repo_env=CC=clang --test_output=errors + run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++17' --repo_env=CC=clang --test_output=errors //implementation/legacy/... macos-latest-cpp20: runs-on: macos-latest @@ -37,3 +38,41 @@ jobs: - uses: actions/checkout@v4 - name: test run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++20' --repo_env=CC=clang --test_output=errors ... + + # These are the new jobs that will be migrated to. + ubuntu-latest-cpp17-clang: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: test + run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++17' --repo_env=CC=clang --test_output=errors //implementation/legacy/... + + ubuntu-latest-cpp20-clang: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: test + run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++20' --repo_env=CC=clang --test_output=errors ... + + # Commented out because for some reason Github's action runner seems to be + # forcing C++14 which I can't reproduce locally. + # ubuntu-latest-cpp20-gcc: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: test + # run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++20' --repo_env=CC=gcc --test_output=errors ... -- -//implementation/legacy/... + + macos-latest-cpp17-clang: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: test + run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++17' --repo_env=CC=clang --test_output=errors //implementation/legacy/... + + macos-latest-cpp20-clang: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: test + run: bazel test --cxxopt='-Werror' --cxxopt='-std=c++20' --repo_env=CC=clang --test_output=errors ... diff --git a/BUILD b/BUILD index 7949e520..f3d79daf 100644 --- a/BUILD +++ b/BUILD @@ -82,6 +82,7 @@ cc_library( "//implementation/jni_helper:static_field_value", "//metaprogramming:corpus", "//metaprogramming:corpus_tag", + "//metaprogramming:string_literal", ], ) diff --git a/implementation/BUILD b/implementation/BUILD index 32f82380..096ae00a 100644 --- a/implementation/BUILD +++ b/implementation/BUILD @@ -41,21 +41,15 @@ cc_library( name = "array_ref", hdrs = ["array_ref.h"], deps = [ - ":array", ":array_view", - ":class", ":class_ref", - ":default_class_loader", ":forward_declarations", - ":jni_type", ":local_object", - ":object_ref", + ":no_idx", ":promotion_mechanics_tags", - ":ref_base", "//:jni_dep", "//implementation/jni_helper:jni_array_helper", "//implementation/jni_helper:lifecycle", - "//implementation/jni_helper:lifecycle_object", ], ) @@ -186,14 +180,17 @@ cc_library( hdrs = ["class_loader_ref.h"], deps = [ ":class_loader", + ":class_ref", ":default_class_loader", ":global_object", ":id", ":id_type", ":jni_type", + ":jvm", ":local_object", ":no_idx", ":promotion_mechanics", + ":promotion_mechanics_tags", "//:jni_dep", "//class_defs:java_lang_classes", "//implementation/jni_helper:jni_env", diff --git a/implementation/array_ref.h b/implementation/array_ref.h index 168b6a26..17563e43 100644 --- a/implementation/array_ref.h +++ b/implementation/array_ref.h @@ -19,7 +19,9 @@ // IWYU pragma: private, include "third_party/jni_wrapper/jni_bind.h" +#include #include +#include #include "implementation/array_view.h" #include "implementation/class_ref.h" @@ -27,6 +29,7 @@ #include "implementation/jni_helper/jni_array_helper.h" #include "implementation/jni_helper/lifecycle.h" #include "implementation/local_object.h" +#include "implementation/no_idx.h" #include "implementation/promotion_mechanics_tags.h" #include "jni_dep.h" @@ -50,10 +53,6 @@ class ArrayRef : public ScopedArrayImpl { : Base(AdoptLocal{}, JniArrayHelper::NewArray(size)) {} - template - ArrayRef(const ArrayViewHelper& array_view_helper) - : Base(AdoptLocal{}, array_view_helper.val) {} - explicit ArrayRef(int size) : ArrayRef(static_cast(size)) {} ArrayView Pin(bool copy_on_completion = true) { @@ -133,9 +132,9 @@ class ArrayRef< // e.g. // LocalArray arr { 5, LocalObject {args...} }; // LocalArray arr { 5, GlobalObject {args...} }; - template