llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.3k stars 12.11k forks source link

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

Open llvmbot opened 6 years ago

llvmbot commented 6 years ago
Bugzilla Link 37189
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @JonasToth,@steveire

Extended Description

template class C{}; template class D{}; D<C> f; ^ Loc points here.

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

Returns the source location indicated below.

template class C{}; template class D{}; D<C> f; ^

JonasToth commented 6 years ago

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