[all-commits] [llvm/llvm-project] dee468: [flang][msvc] Work around if constexpr (false) ev...

Michael Kruse via All-commits all-commits at lists.llvm.org
Wed Sep 16 13:02:01 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dee4686227842aa0e8380c7925049a5df9c4f781
      https://github.com/llvm/llvm-project/commit/dee4686227842aa0e8380c7925049a5df9c4f781
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2020-09-16 (Wed, 16 Sep 2020)

  Changed paths:
    M flang/lib/Parser/basic-parsers.h

  Log Message:
  -----------
   [flang][msvc] Work around if constexpr (false) evaluation. NFC.

MSVC tries to expand templates that are in the false-branch of a `if constexpr` construct. In this case, the condition checks whether a tuple has at least one element and then is trying to access it using `std::get<0>`, which fails when the tuple has 0 elements.

The workaround is to extract that case into a separate method.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D87728




More information about the All-commits mailing list