Questions tagged [gcc10]

Version 10.x of the GNU Compiler Collection. The compiler collection provides support for a wide range of languages on an even wider range of platforms.

Version 10.1 was released on 2020-05-07. Version 10.2 was released on 2020-07-23.

See also:

29 questions
7
votes
2 answers

Array subscript out of bounds when struct has zero length array as only member

In the following code: #include template struct CharArray { CharArray() { memset(data_, 0, len); } char data_[len]; }; struct Foobar { CharArray<5> a; CharArray<3> b; CharArray<0> c; }; int main() { …
Olavi
  • 71
  • 4
6
votes
0 answers

Why is gcc-10 not seeing keywords related to coroutine ts?

I have installed gcc-10 compiler on my ubuntu 20.04. I needed to test the work of coroutine ts, so I found an example using coroutines and tried to compile it. exemple: #include #include struct simple { static inline int…
Anton
  • 275
  • 1
  • 9
4
votes
1 answer

Is it possible to mix the 'range-v3' include(s) with the c++ 'ranges' include?

I have access to GCC 10 and compile with -std=c++20, and need views such as generate cache1, concat etc that aren't slated until possibly C++23. I wrote a simple program below that outputs '1 2 2 3 3 3' using range-v3. I tried to mix the range-v3…
4
votes
2 answers

std::vector null pointer dereference from g++ -fanalyzer

I was experimenting with -fanalyzer on gcc 10, and managed to get a null-pointer dereference reported in std::vector. But I'm not sure if my code has some mistake? #include class Bar { public: explicit Bar() { } int…
Douglas Leeder
  • 52,368
  • 9
  • 94
  • 137
4
votes
1 answer

Boost bimap fails to compile with gcc 10, c++20. Looking for temporary fix

With gcc 10.1 and boost 1.73.0, the following code #include int main() { boost::bimap lookup; } fails to compile with flags -O2 --std=c++20, but will succeed with flags -O2 -std=c++17 (verified with compiler…
yoyoy
  • 375
  • 3
  • 13
4
votes
2 answers

Does native C have common symbol?

In GCC10, gcc default to fno-common. That means, all tentative defined symbols are not common. I think gcc conforms to the C specification but it seems there are no common symbols in the native C program. Are common symbols only for extension…
eddie kuo
  • 716
  • 1
  • 5
  • 13
2
votes
1 answer

Why doesn't gcc10 see the -fcoroutines flag?

I am trying to compile a program with #include header file included in it. But gcc10 throws an error /usr/include/c++/10/coroutine:295:2: error: #error "the coroutine header requires -fcoroutines" 295 | #error "the coroutine header…
Anton
  • 275
  • 1
  • 9
2
votes
0 answers

Error: cannot compute suffix of object files: cannot compile while building GCC 10 with offloading OpenACC Support to Nvidia GPU

I am trying to install GCC 10 for Nvidia PTX on Ubuntu 20.04 so that I can offload the openACC loads to Nvidia GPU. I am following the steps given in this link Installing nvptx-tools git clone…
2
votes
1 answer

Why does conceptual class template specialization cause an error

I tried to build the following with gcc 10 -std=gnu++20 -fconcepts: template class MyClass{ T a; }; template class MyClass{ T a; }; Why does this code cause the following error? > declaration of…
Silicomancer
  • 8,604
  • 10
  • 63
  • 130
1
vote
1 answer

Bootstrapped GCC is using incorrect search paths

I'm attempting to build GCC 10.5 for an older version of QNX on an x86 platform in an Ubuntu 20.04 x86_64 environment. I downloaded the gcc-10.5.0.tar.xz file from GNU's FTP server and ran the following commands: tar -xvf gcc-10.5.0.tar.xz cd…
1
vote
2 answers

workaround for dynamic formatting specs with fmt

Is there a way to use fmt with a spec that is computed at runtime. Noticed that with gcc 10 this code worked fine but not with modern gcc. #include const char* get_spec(bool test) { // image this is implemented in some other .cpp…
Mikhail
  • 7,749
  • 11
  • 62
  • 136
1
vote
2 answers

Can this incomplete type be improved to work with this C++ concept?

The following code works as designed with g++ 9.3.1 and the old concepts TS. But I haven't gotten it to work with g++ 10.3.1 and the C++ core language version of concepts: #if __cpp_concepts < 201707 # define CONCEPT concept bool #else # define…
dave_k_smith
  • 655
  • 1
  • 7
  • 22
1
vote
1 answer

gcc 10 support for atomic shared_ptr

I thought g++ 10.3 should have supported the C++20 feature of atomic shared_ptr? But I am still getting the following error #include #include #include int main() { std::atomic> a =…
Kenneth
  • 561
  • 1
  • 5
  • 13
1
vote
2 answers

Linux Debian 10 how to use c++ 20

Well unluky as I am i had to a hard drive crash and had to reinstall my Linux. I tried to use vs studio code with C++20 but he does not recognize it. Below is my config. { "version": "2.0.0", "tasks": [ { "type":…
Nasten1988
  • 86
  • 8
1
vote
1 answer

atomic_wait and similar methods in c++ 20 and g++ 10.2

I am compiling with g++ 10.2 using -std=c++20 but i get errors like error: ‘atomic_notify_one’ is not a member of ‘std’. I see in the docs that those methods are supported in c++20. Do i miss something?
christk
  • 834
  • 11
  • 23
1
2