This is a follow-up to PR153488 and PR155840, this time for expressions of logical type. The handling of logical operations in Expr<T> differs slightly from regular arithmetic operations. The difference is that the specific operation (e.g. and, or, etc.) is not a part of the type, but stored as a data member. Both the matching code and the reconstruction code needed to be extended to correctly handle the data member. This fixes https://github.com/llvm/llvm-project/issues/144944