[PATCH] D111453: Delay trailing constraing evaluation so we short-circuit

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 8 11:52:39 PDT 2021


erichkeane created this revision.
erichkeane added reviewers: rsmith, hubert.reinterpretcast, saar.raz, arthur.j.odwyer, aaron.ballman, changyu, nwilson, cor3ntin.
erichkeane requested review of this revision.

As reported as a part of PR47508 (and somewhat confirmed in PR44833),
our behavior to fully instantiate the constraint before checking it is
not compliant with the standard.

I found that by delaying this checking until after the function-decl is
created and we CheckInstantiatedFunctionTemplateConstraints, we can take
advantage of its ability to partially instantiate as we short-circuit.


https://reviews.llvm.org/D111453

Files:
  clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
  clang/test/SemaTemplate/trailing-return-short-circuit.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111453.378325.patch
Type: text/x-patch
Size: 4719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211008/8756d5bb/attachment.bin>


More information about the cfe-commits mailing list