[flang-commits] [mlir] [flang] Make MLIR Value more consistent in terms of `const` "correctness" (NFC) (PR #72765)

Mehdi Amini via flang-commits flang-commits at lists.llvm.org
Wed Nov 22 14:47:49 PST 2023


================
@@ -335,8 +335,9 @@ namespace llvm {
     MutableArrayRef(T *begin, T *end) : ArrayRef<T>(begin, end) {}
 
     /// Construct a MutableArrayRef from a SmallVector.
-    /*implicit*/ MutableArrayRef(SmallVectorImpl<T> &Vec)
-    : ArrayRef<T>(Vec) {}
+    template <typename U>
+    /*implicit*/ MutableArrayRef(const SmallVectorTemplateCommon<T, U> &Vec)
+        : ArrayRef<T>(Vec) {}
----------------
joker-eph wrote:

> - I think if it's testable behavior that's intended to be part of the public API (not an implementation detail), we should test it - it's easy to do and helpful to keep track of the intended behavior over time

I agree with this characterization: we just disagree on what is  "testable behavior" because I don't see "parser doesn't complain without a 'cast'" as a "behavior of the program".
(of course we want test coverage, that does not necessarily mean individual C++ unit-test of each C++ API, I know you're not saying that right now, but the different isn't super obvious to me).

> Perhaps this'd be an easier conversation in person some time.

I mean we can punt until the next "seemingly NFC" change that touches ADT? :)


https://github.com/llvm/llvm-project/pull/72765


More information about the flang-commits mailing list