<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/153540>153540</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang getBeginLoc of some CXXConstructExpr has moved past namespace prefix
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          stbergmann
      </td>
    </tr>
</table>

<pre>
    With test.cc being
```
namespace N { template<typename T> struct S { S(T); }; }
int main() {
  N::S(0);
}
```
doing `clang++ -fsyntax-only -Xclang -ast-dump test.cc` shows that, for recent LLVM trunk, the begin of the statement `N::S(0);` has moved from col 3 (before `N::?),
```
`-FunctionDecl 0x55bacea168b8 <line:2:1, line:4:1> line:2:5 main 'int ()'
  `-CompoundStmt 0x55bacea171b8 <col:12, line:4:1>
 `-CXXFunctionalCastExpr 0x55bacea17190 <line:3:3, col:9> 'N::S' functional cast to N::S <ConstructorConversion>
      `-CXXConstructExpr 0x55bacea17000 <col:3, col:9> 'N::S' 'void (int)'
        `-IntegerLiteral 0x55bacea16a68 <col:8> 'int' 0
```
to col 6 (after `N::`),
```
`-FunctionDecl 0x3f53d5d8 <line:2:1, line:4:1> line:2:5 main 'int ()'
  `-CompoundStmt 0x3f561d18 <col:12, line:4:1>
    `-CXXFunctionalCastExpr 0x3f561cf0 <line:3:6, col:9> 'N::S<int>' functional cast to N::S <ConstructorConversion>
 `-CXXConstructExpr 0x3f561b60 <col:6, col:9> 'N::S<int>' 'void (int)'
 `-IntegerLiteral 0x3f53d7a8 <col:8> 'int' 0
```
(which trips up one of the LibreOffice Clang plugins).

@mizvekov: I assume this is related to recent <https://github.com/llvm/llvm-project/commit/91cdd35008e9ab32dffb7e401cdd7313b3461892> "[clang] Improve nested name specifier AST representation (https://github.com/llvm/llvm-project/pull/147835)".
</pre>
<img width="1" height="1" alt="" src="http://email.email.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