]> granicus.if.org Git - clang/commit
Driver: Fix use of dangling std::string temporary
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 18 Feb 2015 18:45:54 +0000 (18:45 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 18 Feb 2015 18:45:54 +0000 (18:45 +0000)
commit77cd074b2f44d342085066e3a2046e76a8d0a655
tree9c27ad0a5128be7aff521ac8d98eadc751e26da9
parent6e4c907c67457f6779b721d67697260f7901f03a
Driver: Fix use of dangling std::string temporary

What's going on here is that the ternary operator produces a std::string rvalue
that the StringRef points to. I'd hoped bugs like this were a thing of the past
with our asan testing but apparently this code path is only used when LLVM is
configured with a custom --with-c-include-dirs setting.

Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229719 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains.cpp