[all-commits] [llvm/llvm-project] 93cc9d: Revert "Properly convert all declaration non-type ...

David L. Jones via All-commits all-commits at lists.llvm.org
Wed Dec 4 22:31:50 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 93cc9dddd82f9e971f382ade6acf6634c5914966
      https://github.com/llvm/llvm-project/commit/93cc9dddd82f9e971f382ade6acf6634c5914966
  Author: David L. Jones <dlj at google.com>
  Date:   2019-12-04 (Wed, 04 Dec 2019)

  Changed paths:
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/test/SemaCXX/exceptions-seh.cpp
    M clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp

  Log Message:
  -----------
  Revert "Properly convert all declaration non-type template arguments when"

This reverts commit 11d10527852b4d3ed738aa90d8bec0f398160593.

This change is problematic with function pointer template parameters. For
example, building libcxxabi with futexes (-D_LIBCXXABI_USE_FUTEX) produces this
diagnostic:

    In file included from .../llvm-project/libcxxabi/src/cxa_guard.cpp:15:
    .../llvm-project/libcxxabi/src/cxa_guard_impl.h:416:54: error: address of function 'PlatformThreadID' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
        has_thread_id_support(this->thread_id_address && GetThreadIDArg),
                                                      ~~ ^~~~~~~~~~~~~~
    .../llvm-project/libcxxabi/src/cxa_guard.cpp:38:26: note: in instantiation of member function '__cxxabiv1::(anonymous namespace)::InitByteFutex<&__cxxabiv1::(anonymous namespace)::PlatformFutexWait, &__cxxabiv1::(anonymous namespace)::PlatformFutexWake, &__cxxabiv1::(anonymous namespace)::PlatformThreadID>::InitByteFutex' requested here
      SelectedImplementation imp(raw_guard_object);
                             ^
    .../llvm-project/libcxxabi/src/cxa_guard_impl.h:416:54: note: prefix with the address-of operator to silence this warning
        has_thread_id_support(this->thread_id_address && GetThreadIDArg),
                                                         ^
                                                         &
    1 error generated.

The diagnostic is incorrect: adding the address-of operator also fails ("cannot
take the address of an rvalue of type 'uint32_t (*)()' (aka 'unsigned int
(*)()')").




More information about the All-commits mailing list