Skip to content

Commit 9db8e6c

Browse files
committed
goto-cc: Fix compilation with GCC 11
The reference type caused following error: /builddir/build/BUILD/cbmc/src/goto-cc/ms_link_cmdline.cpp:337:26: error: loop variable 'ms_link_option' of type 'const string&' {aka 'const std::__cxx11::basic_string<char>&'} binds to a temporary constructed from type 'const char*' [-Werror=range-loop-construct] 337 | for(const std::string &ms_link_option : ms_link_options) | ^~~~~~~~~~~~~~ /builddir/build/BUILD/cbmc/src/goto-cc/ms_link_cmdline.cpp:337:26: note: use non-reference type 'const string' {aka 'const std::__cxx11::basic_string<char>'} to make the copy explicit or 'const char* const&' to prevent copying
1 parent eea16dd commit 9db8e6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/goto-cc/ms_link_cmdline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void ms_link_cmdlinet::process_link_option(const std::string &s)
333333
return;
334334
}
335335

336-
for(const std::string &ms_link_option : ms_link_options)
336+
for(const std::string ms_link_option : ms_link_options)
337337
{
338338
// These are case insensitive.
339339
if(

0 commit comments

Comments
 (0)