[PATCH] D81615: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local variables in default arguments.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 16:41:44 PDT 2020


rsmith accepted this revision.
rsmith marked 2 inline comments as done.
rsmith added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:98
+    //
+    if (DRE->isNonOdrUse() != NOUR_Unevaluated)
+      return S.Diag(DRE->getBeginLoc(),
----------------
I think this is an oversight, and we should probably allow all non-odr-use mentions here. I'll take this to the committee to check. But let's go with the rule as written for now.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:114
+    //
+    if (VDecl->isLocalVarDecl() && !DRE->isNonOdrUse())
       return S.Diag(DRE->getBeginLoc(),
----------------
Do we perform this check after finishing the full-expression and properly setting the 'non-odr-use' bits? Oh, I see, that's what the follow-up change is about :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81615





More information about the cfe-commits mailing list