Fix for OpenMP offloading compilation error with GNU++20 option when using complex header (#115306) The change done is to fix this issue. [[Issue](https://github.com/llvm/llvm-project/issues/113207)] discussion available in link provided. When using the -std=c++20 flag with -fopenmp for OpenMP offloading results in the following compilation error. Reduced test Case : ``` > cat foo.cpp #include <complex> void foo(){ } > CC -fopenmp -std=gnu++20 -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx90a foo.cpp -c In file included from foo.cpp:1: In file included from /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/openmp_wrappers/complex:51: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/openmp_wrappers/complex_cmath.h:68:40: error: non-constexpr declaration of 'conj' follows constexpr declaration 68 | template <class _Tp> std::complex<_Tp> conj(const std::complex<_Tp> &__c) { | ^ /usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/complex:970:5: note: previous declaration is here 970 | conj(const complex<_Tp>& __z) | ^ 1 error generated. ``` Co-authored-by: Chandra Ghale <ghale@pe31.hpc.amslabs.hpecorp.net>
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.