File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,25 @@ cat >>${CONAN_HOME}/profiles/default <<EOT
104104tools.build:compiler_executables={"c" : "${CC}" , "cpp" : "${CXX}" }
105105EOT
106106EOF
107+
108+ # Apply workaround for gcc 12.1 bug, if needed (fixed in gcc 12.4)
109+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
110+ RUN <<EOF
111+ mkdir test && cd test
112+ cat >main.cpp <<EOT
113+ # include <string>
114+ std::string f() { return "_" + std::string(" " ); }
115+ EOT
116+ ${CXX} -std=c++20 -Wall -Werror -O3 -c main.cpp || touch fail
117+ if [[ -f fail ]]; then
118+ cat >>~/.conan2/profiles/default <<EOT
119+ tools.build:cxxflags=['-Wno-restrict' ]
120+ EOT
121+ fi
122+ cd .. && rm -rf test
123+ EOF
124+
125+
107126# Print the Conan profile to verify the configuration.
108127RUN conan profile show
109128
Original file line number Diff line number Diff line change @@ -117,6 +117,24 @@ cat >>~/.conan2/profiles/default <<EOT
117117tools.build:compiler_executables={"c" : "${CC}" , "cpp" : "${CXX}" }
118118EOT
119119EOF
120+
121+ # Apply workaround for gcc 12.1 bug, if needed (fixed in gcc 12.4)
122+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
123+ RUN <<EOF
124+ mkdir test && cd test
125+ cat >main.cpp <<EOT
126+ # include <string>
127+ std::string f() { return "_" + std::string(" " ); }
128+ EOT
129+ ${CXX} -std=c++20 -Wall -Werror -O3 -c main.cpp || touch fail
130+ if [[ -f fail ]]; then
131+ cat >>~/.conan2/profiles/default <<EOT
132+ tools.build:cxxflags=['-Wno-restrict' ]
133+ EOT
134+ fi
135+ cd .. && rm -rf test
136+ EOF
137+
120138# Print the Conan profile to verify the configuration.
121139RUN conan profile show
122140
You can’t perform that action at this time.
0 commit comments