diff --git a/.travis.yml b/.travis.yml index c7f879a70..4dae911dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ addons: - pkg-config before_install: - - wget https://github.com/bazelbuild/bazel/releases/download/0.9.0/bazel_0.9.0-linux-x86_64.deb - - sudo dpkg -i bazel_0.9.0-linux-x86_64.deb + - wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel_0.17.2-linux-x86_64.deb + - sudo dpkg -i bazel_0.17.2-linux-x86_64.deb script: - bazel test ... diff --git a/WORKSPACE b/WORKSPACE index 610b4b954..cdf03eb12 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -6,8 +6,8 @@ http_archive( http_archive( name = "com_google_protobuf", - strip_prefix = "protobuf-3.5.0", - urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"], + strip_prefix = "protobuf-3.5.1", + urls = ["https://github.com/google/protobuf/archive/v3.5.1.zip"], ) http_archive( diff --git a/common/BUILD.bazel b/common/BUILD.bazel index afebdb142..faecb9bc5 100644 --- a/common/BUILD.bazel +++ b/common/BUILD.bazel @@ -184,9 +184,6 @@ cc_library( cc_test( name = "converters_test", srcs = ["converters_test.cc"], - data = [ - "@com_google_cel_spec//testdata", - ], deps = [ ":converters", ":value", @@ -194,13 +191,3 @@ cc_test( "@com_google_googletest//:gtest_main", ], ) - -cc_library( - name = "cel_operators", - srcs = [ - "cel_operators.cc", - ], - hdrs = [ - "cel_operators.h", - ], -) diff --git a/common/cel_operators.cc b/common/cel_operators.cc deleted file mode 100644 index f1d91f081..000000000 --- a/common/cel_operators.cc +++ /dev/null @@ -1,34 +0,0 @@ -#include "common/cel_operators.h" - -namespace google { -namespace api { -namespace expr { - -constexpr char Operators::CONDITIONAL_NAME[]; -constexpr char Operators::LOGICAL_AND_NAME[]; -constexpr char Operators::LOGICAL_OR_NAME[]; -constexpr char Operators::LOGICAL_NOT_NAME[]; -constexpr char Operators::IN_NAME[]; -constexpr char Operators::EQUALS_NAME[]; -constexpr char Operators::NOT_EQUALS_NAME[]; -constexpr char Operators::LESS_NAME[]; -constexpr char Operators::LESS_EQUALS_NAME[]; -constexpr char Operators::GREATER_NAME[]; -constexpr char Operators::GREATER_EQUALS_NAME[]; -constexpr char Operators::ADD_NAME[]; -constexpr char Operators::SUBTRACT_NAME[]; -constexpr char Operators::MULTIPLY_NAME[]; -constexpr char Operators::DIVIDE_NAME[]; -constexpr char Operators::MODULO_NAME[]; -constexpr char Operators::NEGATE_NAME[]; -constexpr char Operators::INDEX_NAME[]; -constexpr char Operators::HAS_NAME[]; -constexpr char Operators::ALL_NAME[]; -constexpr char Operators::EXISTS_NAME[]; -constexpr char Operators::EXISTS_ONE_NAME[]; -constexpr char Operators::MAP_NAME[]; -constexpr char Operators::FILTER_NAME[]; - -} // namespace expr -} // namespace api -} // namespace google diff --git a/common/cel_operators.h b/common/cel_operators.h deleted file mode 100644 index ea6628a24..000000000 --- a/common/cel_operators.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef THIRD_PARTY_CEL_CPP_COMMON_CEL_OPERATORS_H_ -#define THIRD_PARTY_CEL_CPP_COMMON_CEL_OPERATORS_H_ - -namespace google { -namespace api { -namespace expr { - -class Operators { - public: - static constexpr char CONDITIONAL_NAME[] = "_?_:_"; - static constexpr char LOGICAL_AND_NAME[] = "_&&_"; - static constexpr char LOGICAL_OR_NAME[] = "_||_"; - static constexpr char LOGICAL_NOT_NAME[] = "!_"; - static constexpr char IN_NAME[] = "_in_"; - static constexpr char EQUALS_NAME[] = "_==_"; - static constexpr char NOT_EQUALS_NAME[] = "_!=_"; - static constexpr char LESS_NAME[] = "_<_"; - static constexpr char LESS_EQUALS_NAME[] = "_<=_"; - static constexpr char GREATER_NAME[] = "_>_"; - static constexpr char GREATER_EQUALS_NAME[] = "_>=_"; - static constexpr char ADD_NAME[] = "_+_"; - static constexpr char SUBTRACT_NAME[] = "_-_"; - static constexpr char MULTIPLY_NAME[] = "_*_"; - static constexpr char DIVIDE_NAME[] = "_/_"; - static constexpr char MODULO_NAME[] = "_%_"; - static constexpr char NEGATE_NAME[] = "-_"; - static constexpr char INDEX_NAME[] = "_[_]"; - static constexpr char HAS_NAME[] = "has"; - static constexpr char ALL_NAME[] = "all"; - static constexpr char EXISTS_NAME[] = "exists"; - static constexpr char EXISTS_ONE_NAME[] = "exists_one"; - static constexpr char MAP_NAME[] = "map"; - static constexpr char FILTER_NAME[] = "filter"; -}; - -} // namespace expr -} // namespace api -} // namespace google - -#endif // THIRD_PARTY_CEL_CPP_COMMON_CEL_OPERATORS_H_ diff --git a/common/enum.h b/common/enum.h index 0613e63dd..714f0597d 100644 --- a/common/enum.h +++ b/common/enum.h @@ -33,8 +33,8 @@ class UnnamedEnumValue final : public internal::RefCountable { public: ~UnnamedEnumValue() = default; - inline constexpr int32_t value() const { return value_; } - inline constexpr EnumType type() const { return type_; } + inline int32_t value() const { return value_; } + inline EnumType type() const { return type_; } std::string ToString() const; diff --git a/common/type.cc b/common/type.cc index fc9d7f845..d1300ebfe 100644 --- a/common/type.cc +++ b/common/type.cc @@ -10,7 +10,7 @@ namespace expr { namespace { constexpr const std::size_t kBasicTypeNamesSize = 10; -const auto* kBasicTypeNames = new std::array{ +const auto* kBasicTypeNames = new std::array({ "null_type", // kNull "bool", // kBool "int", // kInt @@ -21,7 +21,7 @@ const auto* kBasicTypeNames = new std::array{ "type", // kType "map", // kMap "list", // kList -}; +}); static_assert(kBasicTypeNamesSize == static_cast(BasicTypeValue::DO_NOT_USE), diff --git a/common/type.h b/common/type.h index b9a9db3fa..57dcf9c95 100644 --- a/common/type.h +++ b/common/type.h @@ -137,10 +137,10 @@ class Type final { inline EnumType enum_type() const { return absl::get(data_); } inline ObjectType object_type() const { return absl::get(data_); } - constexpr inline bool operator==(const Type& rhs) const { + inline bool operator==(const Type& rhs) const { return data_ == rhs.data_; } - constexpr inline bool operator!=(const Type& rhs) const { + inline bool operator!=(const Type& rhs) const { return data_ != rhs.data_; } diff --git a/internal/hash_util.h b/internal/hash_util.h index 8c025f13e..7caeadfbe 100644 --- a/internal/hash_util.h +++ b/internal/hash_util.h @@ -95,7 +95,7 @@ std::size_t HashImpl(const T& value, specialize_for) { // Specialization for enums. template -specialize_ift, std::size_t> HashImpl(T&& v) { +std::size_t HashImpl(T&& v, specialize_ift>) { return Hash(static_cast::type>(v)); }