[PATCH] D146178: [Clang][Sema] Fix comparison of constraint expressions

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 13:57:37 PDT 2023


alexander-shaposhnikov added a comment.

I've debugged a bit what's going on in https://godbolt.org/z/7h3sPe85h
we pass ForConstaintInstantiation=true and this causes 
us for the in-class FunctionTemplateDecl pick up the outer layer of template args (i.e. MLTAL will contain NumRetainedOuterLevels: 0 0: <T2>), while for the out-of-line FunctionTemplateDecl MLTAL is empty. This breaks the comparison (after the substitution) since Clang thinks that it's removing one layer of template args. For example, if we pass ForConstaintInstantiation=true the code will compile.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146178/new/

https://reviews.llvm.org/D146178



More information about the cfe-commits mailing list