question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the bug

getting gcc error in clang-output window

Steps to reproduce

  1. https://godbolt.org
  2. open two compiler windows
  3. select gcc-11.2 on the left, clang-13 on the right.
  4. add (broken) example code below
  5. add compiler options for gcc-11.2: -Wall -Wextra -fcoroutines
  6. add compiler options for clang-13: -Wall -Wextra
#include <type_traits>
#include <limits>
#include <fmt/core.h>
#include <coroutine>

int gen()
{
    co_yield 42;
    co_yield 44;
    co_yield 46;
}

int main()
{
    fmt::print("{}\n", gen());
    fmt::print("{}\n", gen());
    fmt::print("{}\n", gen());
}

Expected behavior

error message: “error: unable to find the promise type for this coroutine in both” or similar in both output windows

Actual behaviour:

getting:

In file included from <source>:4:
/opt/compiler-explorer/gcc-11.2.0/lib/gcc/x86_64-linux-gnu/11.2.0/../../../../include/c++/11.2.0/coroutine:334:2: error: "the coroutine header requires -fcoroutines"
#error "the coroutine header requires -fcoroutines"

in the CLANG-13 output window, see screenshot

Reproduction link

https://godbolt.org/z/fqj5fv686

Screenshots

image

Operating System

Windows 11

Browser version

Chrome Version 98.0.4758.102 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
janwilmanscommented, Feb 17, 2022

The error is most likely a macro in the header file, and by default clang uses gcc’s stdlibc++

ok, so then the gcc version is fine, its clang that needs to either support -fcoroutines or not-use gcc’s stdlibc++. I think a workaround is using clang-trunk. closing.

0reactions
partoufcommented, Feb 17, 2022

I don’t think so, remember, the correct behaviour is: “error: unable to find the promise type for this coroutine”

but its the CLANG-13 output window reporting a gcc error??? that can’t right??

The error is most likely a macro in the header file, and by default clang uses gcc’s stdlibc++

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug Definition & Meaning - Merriam-Webster
The meaning of BUG is any of an order (Hemiptera and especially its suborder Heteroptera) of insects (such as an assassin bug or...
Read more >
Bug (2006) - IMDb
An unhinged war veteran holes up with a lonely woman in a spooky Oklahoma motel room. The line between reality and delusion is...
Read more >
bug - Wiktionary
(entomology) An insect of the order Hemiptera (the “true bugs”). Any of various species of marine or freshwater crustaceans; e.g. a Moreton Bay...
Read more >
Bug - Wikipedia
A terrestrial arthropod animal (with at least six legs). Insect, a six-legged arthropod · Covert listening device, used in surveillance, espionage and policing ......
Read more >
BUG | definition in the Cambridge English Dictionary
bug noun (INSECT) ... an insect: Some tiny white bugs had eaten the leaves of my house plants. ... A bug is also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found