[PATCH] D150730: [Clang][Sema] Substitute constraints only for declarations with different lexical contexts

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 17 21:13:09 PDT 2023


shafik added inline comments.


================
Comment at: clang/lib/Sema/SemaConcept.cpp:783
     return true;
-  if (Old && New && Old != New) {
+  if (Old && New && Old != New &&
+      Old->getLexicalDeclContext() != New->getLexicalDeclContext()) {
----------------
shafik wrote:
> erichkeane wrote:
> > Please put the standards quote that supports this here, it'll be really useful in the future.(temp.constr.decl p4)
> Yes, the change makes a lot more sense with the quote. 
> 
> 
I noticed you landed this w/ the citation but w/o quoting the text. Usually it is helpful to quote it b/c it explains the code that follows w/o the reader having to open the standard and read it and then go back to the code. 

In this case I think quoting up to the "outside the class body" may be sufficient.

Worth also noting that paragraphs often move around and so years later the reader may have a hard time matching up. At least w/ the quoted text they have material to start an investigation with if the wording has moved and or changed. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150730



More information about the cfe-commits mailing list