1// { dg-do run } 2// { dg-options "-std=c++11" } 3 4#include <string> 5#include <stdexcept> 6 7const std::string err_prefix = "Problem: "; 8void thrower (std::string msg) 9{ 10 throw std::runtime_error(err_prefix + std::move(msg)); 11} 12 13int main(int argc, char **argv) 14{ 15 try { 16 std::string base = "hello"; 17 thrower(std::move(base)); 18 } catch (const std::runtime_error &e) { 19 } 20 return 0; 21} 22