abseil/abseil-cpp

[Bug]: My application's clang-tidy build failing from abseil package.

Closed this issue · 1 comments

Describe the issue

I am getting the following build errors in my application build from abseil conan package. Our application is based on C++14.
From abseil source code, I understand this will happen only if ABSL_USES_STD_VARIANT is defined.

Logs

`/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:54:12: error: no member named 'bad_variant_access' in namespace 'std' [clang-diagnostic-error]
using std::bad_variant_access;

/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:56:12: error: no member named 'get_if' in namespace 'std' [clang-diagnostic-error]
using std::get_if;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:57:12: error: no member named 'holds_alternative' in namespace 'std' [clang-diagnostic-error]
using std::holds_alternative;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:58:12: error: no member named 'monostate' in namespace 'std' [clang-diagnostic-error]
using std::monostate;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:59:12: error: no member named 'variant' in namespace 'std' [clang-diagnostic-error]
using std::variant;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:60:12: error: no member named 'variant_alternative' in namespace 'std' [clang-diagnostic-error]
using std::variant_alternative;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:61:12: error: no member named 'variant_alternative_t' in namespace 'std' [clang-diagnostic-error]
using std::variant_alternative_t;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:62:12: error: no member named 'variant_npos' in namespace 'std' [clang-diagnostic-error]
using std::variant_npos;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:63:12: error: no member named 'variant_size' in namespace 'std' [clang-diagnostic-error]
using std::variant_size;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:64:12: error: no member named 'variant_size_v' in namespace 'std' [clang-diagnostic-error]
using std::variant_size_v;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:65:12: error: no member named 'visit' in namespace 'std' [clang-diagnostic-error]
using std::visit;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/types/variant.h:859:16: error: no member named 'visit' in namespace 'absl' [clang-diagnostic-error]
return absl::visit(variant_internal::ConversionVisitor{},
~~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/utility/utility.h:164:12: error: no member named 'in_place_t' in namespace 'std' [clang-diagnostic-error]
using std::in_place_t;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/utility/utility.h:165:12: error: no member named 'in_place' in namespace 'std' [clang-diagnostic-error]
using std::in_place;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/utility/utility.h:181:12: error: no member named 'in_place_type' in namespace 'std' [clang-diagnostic-error]
using std::in_place_type;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/utility/utility.h:182:12: error: no member named 'in_place_type_t' in namespace 'std' [clang-diagnostic-error]
using std::in_place_type_t;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/utility/utility.h:198:12: error: no member named 'in_place_index' in namespace 'std' [clang-diagnostic-error]
using std::in_place_index;
~~~~~^
/root/.conan/data/abseil/20230802.1///package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/utility/utility.h:199:12: error: no member named 'in_place_index_t' in namespace 'std' [clang-diagnostic-error]
using std::in_place_index_t;
~~~~~^`

My conan file looks like something below.
`class AppConan(ConanFile):
    name = "app"
    description = "Application"
    settings = "os", "compiler", "build_type", "arch"
    requires = (
        "gtest/[1.8.x]",
        "fmt/[8.x]",
       ....
        "abseil/20230802.1"`

My conan profile look like this:
`[settings]
compiler.libcxx=libstdc++11
cppstd=gnu14
arch=x86_64
build_type=Release
compiler=gcc

[conf]
tools.cmake.cmaketoolchain:user_toolchain=['$PROFILE_DIR/../../toolchain/clang-tidy.cmake']`

I also tried changing `cppstd` to `gnu17`, but doesn't fix the abseil build issue.

Seems like bincrafters abseil package is not currently maintained. Hence that also didn't work.
Could some one guide me how can I resolve this issue?

Thanks,
Honey

Honey Sukesan

### Steps to reproduce the problem

Use `abseil/20230802.1` in conan file and try to build an application.

### What version of Abseil are you using?

abseil/20230802.1

### What operating system and version are you using?

# Package and Environment Details
Package Name/Version: abseil/20230802.1
Operating System+version: Linux Ubuntu 22.04
Conan version: conan 1.59.0

### What compiler and version are you using?

g++ 12

### What build system are you using?

conan with cmake 3.24

### Additional context

_No response_

This is likely because you are building your program with C++14 but the version you are getting from Conan is built with C++17. The Conan version has patches that we do not endorse and we cannot offer support for the Conan version. Sorry.