[PATCH] D65696: Implements CWG 2082 Referring to parameters in unevaluated operands of default arguments

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 24 13:15:07 PST 2021


rsmith added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:143-148
+  /// CheckDefaultArgumentVisitorODR - C++ [dcl.fct.default] Traverses
+  /// the default argument of a parameter to determine whether it
+  /// contains ODR violations. These violations cannot be checked in
+  /// \ref CheckDefaultArgumentVisitor since the DeclRefExp's may be changed to
+  /// an implicit cast from an LValue to RValue by \ref SetParamDefaultArgument.
+  /// When that happens the ODR usage may be allowed.
----------------
Instead of visiting the default argument twice, can we call `SetParamDefaultArgument` first before doing the checks?


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

https://reviews.llvm.org/D65696



More information about the cfe-commits mailing list