[all-commits] [llvm/llvm-project] 4ea9a4: Declare __builtin_strlen in StringRef.h as constexpr

Hans via All-commits all-commits at lists.llvm.org
Mon Feb 3 07:59:47 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ea9a4aba4a7cfea0325022d50b97a9409026ab5
      https://github.com/llvm/llvm-project/commit/4ea9a4aba4a7cfea0325022d50b97a9409026ab5
  Author: Hans Wennborg <hans at chromium.org>
  Date:   2020-02-03 (Mon, 03 Feb 2020)

  Changed paths:
    M llvm/include/llvm/ADT/StringRef.h

  Log Message:
  -----------
  Declare __builtin_strlen in StringRef.h as constexpr

Otherwise Visual Studio 2017 will complain about
llvm::StringRef::strlen not being constexpr:

  StringRef.h(80): error C3615: constexpr function 'llvm::StringRef::strLen' cannot result in a constant expression
  StringRef.h(84): note: failure was caused by call of undefined function or one not declared 'constexpr'

(cherry picked from commit b3d7d1061dc375bb5ea725e6597382fcd37f41d6)




More information about the All-commits mailing list