Category : gcc

[temp.spec]/6 was added to C++20 by implementation of P0692R1 (Access Checking on Specialization) [emphasis mine]: [temp.spec]/6 The usual access checking rules do not apply to names in a declaration of an explicit instantiation or explicit specialization, with the exception of names appearing in a function body, default argument, base-clause, member-specification, enumerator-list, or static data member ..

Read more

I am using Manjaro Linux, Code OSS, Easy C++ project and C/C++ extension and I get this error: Unable to open ‘basic_string.h’: Unable to read file ‘/build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h’ (Error: Unable to resolve non-existing file ‘/build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h’). Does someone have idea for solution? Source: Windows Que..

Read more

I have defined a struct in a header file as ekd_api.h #include <stdint.h> struct udp_rx_data_filter_lookup { uint16_t connection_idx; }; Now I have created a function in a ekd_api.cpp file #include "ekd_api.h" uint32_t qbit_set_udp_rx_connection_idx(uint32_t port_id, struct udp_rx_data_filter_loopkup* _udp_rx_data_filter_loopkup, uint32_t count, uint32_t *extra_info) { port_id = 0; _udp_rx_data_filter_loopkup->connection_idx = 1; } Now when I am trying to ..

Read more

I know that std::async is a C++11 thing but I am pretty sure that my compiler has C++11 support. #include <future> using namespace::std; void functionToRun() { // some code } int main() { auto x = 2; // throws warning warning: ‘auto’ type specifier is a C++11 extension [-Wc++11-extensions] std::future<void> metricLoggerFuture = std::async(std::launch::async, functionToRun); // ..

Read more

Consider the following code: #include <iostream> #include <cstdlib> struct NonAggregate { // Non-aggregate due to user defined constructor // It is also not constexpr explicit NonAggregate(int i) : val_(i) {} int val_; }; template <typename T = int> constexpr NonAggregate GetNonAggregate(NonAggregate foo) { return foo; } int main() { // Let us pass a random ..

Read more

I’m trying to use gnuplot from C++ application, gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04). I’ve encountered strange behavior concerning plotting to files. So, the reproducible example is: #include <iostream> #include <filesystem> int main() { // whatever valid filename std::string name1 = "/tmp/1.png"; // open gnuplot pipe auto gp = popen("gnuplot", "w"); // plot sin(x) to file. ..

Read more