logo
down
shadow

Invalid explicitly-specified argument in clang but successful compilation in gcc — who's wrong?


Invalid explicitly-specified argument in clang but successful compilation in gcc — who's wrong?

By : enns
Date : November 21 2020, 07:38 AM
fixed the issue. Will look into that further As there is no answer for a week, I will post my vision. I am far from being an expert at language-laywering, actually I would consider myself a complete novice, but still. The following is based on my reading of standard, as well on my recent question.
So, first of all let's rewrite the code the following way:
code :
struct A {
    constexpr operator int() const { return 42; }
};

template <int>
void foo() {}

void test(const A& value) {
    foo<value>();
}

int main() {
    A a{};
    test(a);
}


Share : facebook icon twitter icon
xcode/clang: clang: warning: argument unused during compilation: '-fcheck-new'

xcode/clang: clang: warning: argument unused during compilation: '-fcheck-new'


By : Felipe Hertzer
Date : March 29 2020, 07:55 AM
Hope that helps This warning can be silenced by adding the flag -Qunused-arguments
It's a warning because clang does not support the -fcheck-new argument.
clang: warning: argument unused during compilation: '-stdlib=libc++'

clang: warning: argument unused during compilation: '-stdlib=libc++'


By : Ramin
Date : March 29 2020, 07:55 AM
this will help If you want to silence the warning, add -Wno-error=unused-command-line-argument to the LIBRARY_RELEASE_OPTIONS this is required to quell the warning with ccache, distcc, etc.
Also, it's best to use set(CMAKE_CXX_STANDARD 14) rather than adding -std=c++14; to LIBRARY_RELEASE_OPTIONS
Clang 3.8 error: invalid linker name in argument '-fuse-ld=gold-2.25'

Clang 3.8 error: invalid linker name in argument '-fuse-ld=gold-2.25'


By : Naveed Ahmed
Date : March 29 2020, 07:55 AM
Hope this helps I am using Clang 3.8 on CentOS 7.4 to compile a C++ app using third party libraries and their (complicated) makefiles. When including their makefile and running my own I am getting the following error during linkage: , Your clang build does not support linking with gold.
Compilation successful with clang 5.0.1/6.0.0, fails with 5.0.2/6.0.1

Compilation successful with clang 5.0.1/6.0.0, fails with 5.0.2/6.0.1


By : user1628767
Date : March 29 2020, 07:55 AM
Does that help clang was using the c++ library bundled in the system (my understanding is that it does not ship with one bundled, as g++ does?). By default, Ubuntu 14.04 includes g++-4.9's libstdc++, which was outdated (I guess).
Installing e.g. libstdc++-8-dev solved my problem.
Invalid explicitly-specified argument for template parameter which is constexpr

Invalid explicitly-specified argument for template parameter which is constexpr


By : user2240350
Date : March 29 2020, 07:55 AM
I hope this helps you . I have a static_loop construct like this , Suggestion: try with
code :
// .........VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
static_loop<std::tuple_size_v<decltype(ab)>>([&](auto i) { std::get<i>(ab) = i; });
template <typename F, typename ... Ts, std::size_t ... Is>
void run_1_helper (F const & f, std::tuple<Ts...> & t, std::index_sequence<Is...> const)
 { (f(std::get<Is>(t), Is), ...); }

template <typename F, typename ... Ts>
void run_1 (F const & f, std::tuple<Ts...> & t)
 { run_1_helper(f, t, std::index_sequence_for<Ts...>{}); }
struct A {
    int a;
    int b;
    void run() {
        auto ab = std::make_tuple(std::ref(a), std::ref(b));
        run_1([](auto & v, auto i){ v = i; }, ab);
        std::cout << a << " " << b << std::endl;
    }
};
struct A {
    int a;
    int b;
    void run() {
        auto ab = std::make_tuple(std::ref(a), std::ref(b));
        int i { -1 };
        std::apply([&](auto & ... vs){ ((vs = ++i), ...); }, ab);
        std::cout << a << " " << b << std::endl;
    }
};
Related Posts Related Posts :
  • Complexity analysis of loop with limited looping time
  • Boost test fails with enum classes inside namespaces
  • is this a function declaration?
  • Socket recv() one byte at a time
  • C++ Glibc Detected error. Double Free or corruption
  • OpenCV - How to write IplImage array in Mat form?
  • Qt event when anything changed on the window/screen + Screenshot
  • OpenGL Linker error, linking with uncompiled shader
  • Find 4 specific corner pixels and use them with warp perspective
  • Cin Execution Not Working (program.exe < filewithdata.txt)
  • cudaMallocManaged causes Access Violation
  • How to correctly read a value from stdin into a variable
  • Binary Search Tree Forgetting Every Node I Add
  • C++ Return Value from function not same as that value in function
  • Microsoft Visual Studio C++, OpenCV animation
  • C++ function pointer syntax. Why does (*) work but * not?
  • C++: Template class binary operator overloading - seg fault?
  • Passing buffer between two terminals (Named Pipe)
  • C++ parse sub-string to integer
  • Create stereo context for modern opengl
  • Memory leak, when using GLM
  • Get Control under cursor
  • Is this proper behavior? std::map iterator invalidation
  • 2D isometric engine - Math problems - Cube selection - diamond shape map
  • Open second window in Qt
  • Stack Overflow error with Vectors
  • Pure Virtual Friend Class
  • Object initialization syntax in C++
  • Variable undefined error
  • C++ tolower/toupper char pointer
  • Overhead with std::function
  • Is there a way to make a loop that get user input but doesn't stop if the user doesn't input anything?
  • OpenCV in cmake-based project: checking for contrib modules
  • shared_ptr vs unique_ptr uses in classes and children
  • MFC dialog Border padding changed after switching from VS2010 to 2012 or later
  • String rotator in C++ (bitwise rotation)
  • Custom sort vector of pair based on their values
  • Pointer to const overloaded member function
  • how to avoid this for-loop mess in c++?
  • Can the state of a standard C++ iostream manipulator be polled?
  • How to make sure a data type is as large as it needs to be in C++
  • Why is my first ofstream output in my else block missing the fill character?
  • Returning static/ normal arrays in recursion/another function
  • c++, why use const std::string & parameterName?
  • expression did not evaluate to a constant in C++ VS
  • Owner object that takes pre-created values ? Wrong design?
  • Cannot use Macro in a C++ constructor?
  • vector is loosing mat4 information
  • Invalid declarator before with map of struct?
  • std::initializer_list to return member variables returns incorrect values
  • Unable to use Boost + Qt in Mac
  • Passing template function and overload as function argument
  • non standard extension warning when searching in a vector of unique_ptrs
  • Qt Windows x64 build succeeds in IDE but not on the command line
  • condition_variable::wait_for method not returning - even after the timeout
  • boost::asio usage in self-contained class
  • CGAL triangulation with constraints changes points coords
  • How to resolve an ambiguous reference caused by a conflicting identifier from inline namespace
  • When UTF8 emoji character is removed from NSMutableString the conversion to std::string fails
  • XOR of two strings of 0s and 1s
  • shadow
    Privacy Policy - Terms - Contact Us © animezone.co