diff --git a/interpreter/cling/lib/Utils/SourceNormalization.cpp b/interpreter/cling/lib/Utils/SourceNormalization.cpp index 61918e5ccad1f06f04129e0b30a3fe0823c0cfb4..62b0fa8c346e80077e80de42b8d5ec9f99980e8f 100644 --- a/interpreter/cling/lib/Utils/SourceNormalization.cpp +++ b/interpreter/cling/lib/Utils/SourceNormalization.cpp @@ -382,7 +382,10 @@ size_t cling::utils::getWrapPoint(std::string& source, } // There is "more" - let's assume this input consists of a using // declaration or definition plus some code that should be wrapped. - return getFileOffset(Tok); + // + // We need to include the ';' in the offset as this will be a + // non-wrapped statement. + return getFileOffset(Tok) + 1; } if (keyword.equals("extern")) return std::string::npos; diff --git a/interpreter/cling/test/Prompt/DontWrap.C b/interpreter/cling/test/Prompt/DontWrap.C index 022d942d3101dec5e6c430b316317e536839a109..b2ca7486a99cc7d4b2e5cdb82befb20d562ecfb6 100644 --- a/interpreter/cling/test/Prompt/DontWrap.C +++ b/interpreter/cling/test/Prompt/DontWrap.C @@ -228,4 +228,8 @@ int *& RefRPtr = RPtr; cIntStarRef(RefRPtr) // CHECK: (int *) 0x{{[0-9]+}} +namespace Issue_113 {} +// Keep the blank space after the using clause. +using namespace Issue_113; + // expected-no-diagnostics