| 2454 | } |
| 2455 | |
| 2456 | static std::string getLine(const std::string &code, int lineNumber) { |
| 2457 | std::string nr = std::to_string(lineNumber); |
| 2458 | const std::string::size_type pos1 = code.find('\n' + nr + ": "); |
| 2459 | if (pos1 == std::string::npos) |
| 2460 | return ""; |
| 2461 | const std::string::size_type pos2 = code.find('\n', pos1+1); |
| 2462 | if (pos2 == std::string::npos) |
| 2463 | return ""; |
| 2464 | return code.substr(pos1+1, pos2-pos1-1); |
| 2465 | } |
| 2466 | |
| 2467 | void varid_namespace_3() { // #8627 |
| 2468 | const char code[] = "namespace foo {\n" |