[BUG]:
See original GitHub issueDescribe the bug
getting gcc error in clang-output window
Steps to reproduce
- https://godbolt.org
- open two compiler windows
- select gcc-11.2 on the left, clang-13 on the right.
- add (broken) example code below
- add compiler options for gcc-11.2: -Wall -Wextra -fcoroutines
- 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
Operating System
Windows 11
Browser version
Chrome Version 98.0.4758.102 (Official Build) (64-bit)
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
The error is most likely a macro in the header file, and by default clang uses gcc’s stdlibc++