https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97758
Bug ID: 97758 Summary: bits/std_function.h: error: unknown type name 'type_info' when using -fno-exceptions -fno-rtti Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: romain.geissler at amadeus dot com Target Milestone: --- Hi, I am using the trunk from today (8th november, git revision b642fca1c31b2e2175e0860daf32b4ee0d918085). When trying to build clang with it I end up with this error (on Linux x86_64): FAILED: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/ParallelCG.cpp.o /workdir/build/final-system/llvm-build/./bin/clang++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/CodeGen -I/workdir/src/llvm-12.0.0/llvm/lib/CodeGen -Iinclude -I/workdir/src/llvm-12.0.0/llvm/include -isystem /workdir/build/final-system/llvm-temporary-static-dependencies/install/include -O2 -I/workdir/build/final-system/llvm-temporary-static-dependencies/install/include -I/workdir/build/final-system/llvm-temporary-static-dependencies/install/include/ncursesw -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -fprofile-instr-generate="/workdir/build/final-system/llvm-build/tools/clang/stage2-instrumented-bins/profiles/%4m.profraw" -flto -O3 -DNDEBUG -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/ParallelCG.cpp.o -MF lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/ParallelCG.cpp.o.d -o lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/ParallelCG.cpp.o -c /workdir/src/llvm-12.0.0/llvm/lib/CodeGen/ParallelCG.cpp In file included from /workdir/src/llvm-12.0.0/llvm/lib/CodeGen/ParallelCG.cpp:13: In file included from /workdir/src/llvm-12.0.0/llvm/include/llvm/CodeGen/ParallelCG.h:17: In file included from /opt/1A/toolchain/x86_64-v21.0.10/lib64/gcc/x86_64-1a-linux-gnu/11.0.0/../../../../include/c++/11.0.0/functional:59: /opt/1A/toolchain/x86_64-v21.0.10/lib64/gcc/x86_64-1a-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:190:31: error: unknown type name 'type_info' __dest._M_access<const type_info*>() = nullptr; ^ 1 error generated. Note that apparently these llvm files are compiled with -fno-exceptions -fno-rtti, so it seems triggered by the recent changes around std::function without rtti support. Cheers, Romain