public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104503] New: [12 regression][modules] bits/shared_ptr_base.h: error: must ‘#include <typeinfo>’ before using ‘typeid’
@ 2022-02-11 15:00 egor.pugin at gmail dot com
  2022-02-14  8:21 ` [Bug c++/104503] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: egor.pugin at gmail dot com @ 2022-02-11 15:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104503

            Bug ID: 104503
           Summary: [12 regression][modules] bits/shared_ptr_base.h:
                    error: must ‘#include <typeinfo>’ before using
                    ‘typeid’
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egor.pugin at gmail dot com
  Target Milestone: ---

11.2.1 works fine.

#include <typeinfo> is present in include/c++/12.0.1/bits/shared_ptr_base.h

Repro:

cat << EOF > 1.cpp
export module m;
import <bits/stdc++.h>;
EOF
cat << EOF > 2.cpp
import m;
int main(){}
EOF
g++ -std=c++23 -fmodules-ts -x c++-system-header bits/stdc++.h
g++ -std=c++23 -fmodules-ts -c 1.cpp
g++ -std=c++23 -fmodules-ts -c 2.cpp

Error:

In file included from
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr.h:53,
                 from
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/memory:77,
                 from
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/x86_64-pc-linux-gnu/bits/stdc++.h:82,
of module
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/x86_64-pc-linux-gnu/bits/stdc++.h,
imported at 1.cpp:2,
of module m, imported at 2.cpp:1:
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr_base.h:
In instantiation of ‘void* std::_Sp_counted_ptr_inplace<_Tp, _Alloc,
_Lp>::_M_get_deleter(const std::type_info&) [with _Tp = std::mutex; _Alloc =
std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’:
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr_base.h:631:7:
  required from here
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr_base.h:641:21:
error: must ‘#include <typeinfo>’ before using ‘typeid’
   62 | #include <ext/concurrence.h>
  +++ |+#include <typeinfo>
   63 | #if __cplusplus >= 202002L
......
  641 |             __ti == typeid(_Sp_make_shared_tag)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr_base.h:
In instantiation of ‘void* std::_Sp_counted_ptr_inplace<_Tp, _Alloc,
_Lp>::_M_get_deleter(const std::type_info&) [with _Tp =
std::__future_base::_State_baseV2; _Alloc = std::allocator<void>;
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’:
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr_base.h:631:7:
  required from here
/home/egor/dev/gcc/build_debug/install/include/c++/12.0.1/bits/shared_ptr_base.h:641:21:
error: must ‘#include <typeinfo>’ before using ‘typeid’

Build:

Using built-in specs.
COLLECT_GCC=/home/egor/dev/gcc/build_debug/install/bin/g++
COLLECT_LTO_WRAPPER=/home/egor/dev/gcc/build_debug/install/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --disable-bootstrap
--prefix=/home/egor/dev/gcc/build_debug/install --disable-libsanitizer
--disable-gcov --disable-libgomp --disable-libquadmath --disable-libssp
--enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220211 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-10  9:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 15:00 [Bug c++/104503] New: [12 regression][modules] bits/shared_ptr_base.h: error: must ‘#include <typeinfo>’ before using ‘typeid’ egor.pugin at gmail dot com
2022-02-14  8:21 ` [Bug c++/104503] " rguenth at gcc dot gnu.org
2022-03-28 13:33 ` jakub at gcc dot gnu.org
2022-04-07  1:39 ` jason at gcc dot gnu.org
2022-04-07  5:39 ` egor.pugin at gmail dot com
2022-05-10  9:18 ` vanyacpp at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).