llvm-project
304c7a87 - [flang][Evaluate] Restrict ConstantBase constructor overload (#138456)

Commit
267 days ago
[flang][Evaluate] Restrict ConstantBase constructor overload (#138456) ConstantBase has a constructor that takes a value of any type as an input: template <typename T> ConstantBase(const T &). A derived type Constant<T> is a member of many Expr<T> classes (as an alternative in the member variant). When trying (erroneously) to create Expr<T> from a wrong input, if the specific instance of Expr<T> contains Constant<T>, it's that constructor that will be instantiated, leading to cryptic and confusing errors. Eliminate the constructor from overload for invalid input values to help produce more meaningful diagnostics.
Author
Parents
Loading