Skip to content

libcxx test failure when libcxx is build with no exceptions and no RTTI #150601

@vhscampos

Description

@vhscampos

One libcxx test fail if libcxx is build with no exceptions and no RTTI.

libcxx/utilities/expected/expected.expected/value.observers.verify.cpp

The absence of RTTI might not be required to reproduce the failure, but I haven't tested with it enabled. However the absence of exception support is indeed required.

How to reproduce

Disable exceptions and RTTI in libcxx:

cmake ... -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DLIBCXX_ENABLE_EXCEPTIONS=OFF -DLIBCXX_ENABLE_RTTI=OFF

Run the libcxx tests:

ninja check-libcxx

Relevant part of the error message:

******************** TEST 'llvm-libc++-shared.cfg.in :: libcxx/utilities/expected/expected.expected/value.observers.verify.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
/home/vicspe01/Workspace/build/build-upstream-llvm/./bin/clang++ /data_nvme0n1/vicspe01/Workspace/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp -pthread --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/vicspe01/Workspace/build/build-upstream-llvm/runtimes/runtimes-bins/libcxx/test-suite-install/include/x86_64-unknown-linux-gnu/c++/v1 -I /home/vicspe01/Workspace/build/build-upstream-llvm/runtimes/runtimes-bins/libcxx/test-suite-install/include/c++/v1 -I /home/vicspe01/Workspace/llvm-project/libcxx/test/support -std=c++26 -fno-exceptions -fno-rtti -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -Wuser-defined-warnings  -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0
# executed command: /home/vicspe01/Workspace/build/build-upstream-llvm/./bin/clang++ /data_nvme0n1/vicspe01/Workspace/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp -pthread --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/vicspe01/Workspace/build/build-upstream-llvm/runtimes/runtimes-bins/libcxx/test-suite-install/include/x86_64-unknown-linux-gnu/c++/v1 -I /home/vicspe01/Workspace/build/build-upstream-llvm/runtimes/runtimes-bins/libcxx/test-suite-install/include/c++/v1 -I /home/vicspe01/Workspace/llvm-project/libcxx/test/support -std=c++26 -fno-exceptions -fno-rtti -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -Wuser-defined-warnings -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0
# .---command stderr------------
# | error: 'expected-error' diagnostics seen but not expected: 
# |   File /home/vicspe01/Workspace/build/build-upstream-llvm/runtimes/runtimes-bins/libcxx/test-suite-install/include/c++/v1/__expected/expected.h Line 857: call to deleted constructor of 'CopyConstructibleButNotMoveConstructible'
# |   File /home/vicspe01/Workspace/build/build-upstream-llvm/runtimes/runtimes-bins/libcxx/test-suite-install/include/c++/v1/__expected/expected.h Line 848: call to deleted constructor of 'CopyConstructibleButNotMoveConstructible'
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

A bisect points to this PR as culprit: #144220

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.test-suite

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions