def self.compiler_supports_wno_ambiguous_member_template?
result = try_compile("Checking for C++ compiler '-Wno-ambiguous-member-template' support",
:cxx, '', '-Wno-ambiguous-member-template')
return false if !result
create_temp_file("passenger-compile-check.cpp") do |filename, f|
source = %Q{
void foo() {
return error;
}
}
f.puts(source)
f.close
begin
command = create_compiler_command(:cxx,
"-c '#{filename}' -o '#{filename}.o'",
'-Wno-ambiguous-member-template')
result = run_compiler("Checking whether C++ compiler '-Wno-ambiguous-member-template' support is *really* supported",
command, filename, source, :always)
ensure
File.unlink("#{filename}.o") rescue nil
end
end
return result && result[:output] !~ /-Wno-ambiguous-member-template/
end