Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang::Lexer::getLocForEndOfToken is off by one when at end of a doubly nested template list. #36162

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37189
Status NEW
Importance P enhancement
Reported by Edward Brown (edward.brown.96@live.co.uk)
Reported on 2018-04-20 13:30:32 -0700
Last modified on 2018-10-08 04:22:58 -0700
Version unspecified
Hardware PC Linux
CC development@jonas-toth.eu, klimek@google.com, llvm-bugs@lists.llvm.org, steveire@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
template <typename T> class C{};
template <int> class D{};
D<C<int>> f;
       ^
       Loc points here.

Calling Lexer::getLocForEndOfToken(Loc, 0, Context.getSourceManager(),
                                   Context.getLangOpts());

Returns the source location indicated below.

template <typename T> class C{};
template <int> class D{};
D<C<int>> f;
         ^
Quuxplusone commented 5 years ago

I move this bug to the clang frontend, as the Lexer is part of that and the problem is not CTE specific.