Hey all,

I’m troubleshooting an issue and came up with this sample program: 
https://pastebin.com/g9S8Z64q to demonstrate the problem. Basically, clang 13, 
on Rawhide, won’t compile that program, while on Fedora 35 it does.

The reason why is that on Rawhide, stdatomic.h exists under /usr/include/c++/12 
while it does not exist on 35, so clang uses its built-in stdatomic per 
https://clang.llvm.org/docs/LanguageExtensions.html#c11-atomic-operations. If 
it uses its internal version, the sample program compiles fine.

Looking at stdatomic.h on Rawhide, I see it’s gated by “#if __cplusplus > 
202002L”, so that means C++2b or later, not C++20. This seems to create a 
problem for clang which, since the file is present, wants to use it, but since 
it’s effectively empty due to the #ifdef, compiling of the sample program fails.

Is it possible to disable clang’s use of the header file as a flag? I’ve been 
unable to find anything like that, and obviously renaming the header is out of 
the question.  Also, is it correct to the setting stdatomic.h to only be used 
by c++2b?

Thanks for any info,

Ron
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to