rjmccall added inline comments.

================
Comment at: clang/lib/Sema/SemaChecking.cpp:1605
+           }));
+  };
+
----------------
I am not a fan of this lambda style, not because I dislike lambdas, but because 
you've pulled a ton of code that's supporting one or two cases (that could 
easily be handled together) into a much wider scope.

Your helper code are doing a ton of redundant type checks and is probably not 
as general as you think it is.  You need to call 
`DefaultFunctionArrayLvalueConversion` on the pointer arguments, after which 
you can just check for a pointer type.  You also need to convert the size 
argument to a `size_t` as if initializing a parameter.  If you do these things, 
the IRGen code will get much simpler because e.g. it will not need to specially 
handle arrays anymore.  You will also start magically doing the right thing 
w.r.t ODR-uses of constexpr variables.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79279



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to