Skip to content

Commit

Permalink
[cling] cmd prompt skips global scope while parsing func return type
Browse files Browse the repository at this point in the history
e.g. ::class_a class_b::mem_func_b() { return 'w'; }

skip :: right before class_a while calculating wrap point
  • Loading branch information
jiangyilism committed Jun 16, 2023
1 parent 30a152d commit 40e4bef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions interpreter/cling/lib/Utils/SourceNormalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,10 @@ size_t cling::utils::getWrapPoint(std::string& source,
Lex.Lex(Tok);
}

const tok::TokenKind kind = Tok.getKind();
if (Tok.getKind() == tok::coloncolon)
Lex.LexClean(Tok);

if (kind == tok::raw_identifier && !Tok.needsCleaning()) {
if (Tok.getKind() == tok::raw_identifier && !Tok.needsCleaning()) {
StringRef keyword(Tok.getRawIdentifier());
if (keyword.equals("using")) {
// FIXME: Using definitions and declarations should be decl extracted.
Expand Down

0 comments on commit 40e4bef

Please sign in to comment.