1 // P0145R2: Refining Expression Order for C++ 2 // { dg-do run } 3 // { dg-options "-std=c++17" } 4 5 #include <string> 6 #define assert(X) if (!(X)) __builtin_abort(); 7 main()8int main() 9 { 10 std::string s = "but I have heard it works even if you don't believe in it" ; 11 s.replace(0, 4, "" ).replace( s.find( "even" ), 4, "only" ) 12 .replace( s.find( " don't" ), 6, "" ); 13 14 assert( s == "I have heard it works only if you believe in it" ) ; 15 } 16