public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "johelegp at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/110894] [modules] Program terminates with signal SIGSEGV
Date: Thu, 03 Aug 2023 19:41:25 +0000	[thread overview]
Message-ID: <bug-110894-4-bDkUhnNINX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110894-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
If instead I use `std::string_view` in `-O3` (`-O0` works),
it also diagnoses (<https://cpp2.godbolt.org/z/h7zooM35G>):

```
In file included from /app/module.cpp:2,
of module hello, imported at /app/main.cpp:2:
In member function 'constexpr const std::basic_string_view<_CharT,
_Traits>::value_type* std::basic_string_view<_CharT, _Traits>::data() const
[with _CharT = char; _Traits = std::char_traits<char>]',
    inlined from 'std::basic_ostream<_CharT, _Traits>&
std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT,
_Traits>) [with _CharT = char; _Traits = char_traits<char>]' at
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/string_view:762:30,
    inlined from 'int main()' at /app/main.cpp:3:46:
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/string_view:292:22:
warning: 'this' is used uninitialized [-Wuninitialized]
  292 |       { return this->_M_str; }
      |                      ^~~~~~
In file included from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/bits/basic_string.h:47,
                 from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/string:54,
                 from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/bits/locale_classes.h:40,
                 from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/bits/ios_base.h:41,
                 from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/ios:44,
                 from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/ostream:40,
                 from
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/iostream:41,
                 from /app/main.cpp:1:
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/string_view: In
function 'int main()':
/opt/compiler-explorer/gcc-trunk-20230801/include/c++/14.0.0/string_view:760:5:
note: 'this' was declared here
  760 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
```

  reply	other threads:[~2023-08-03 19:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 19:29 [Bug c++/110894] New: " johelegp at gmail dot com
2023-08-03 19:41 ` johelegp at gmail dot com [this message]
2023-08-03 19:50 ` [Bug c++/110894] " pinskia at gcc dot gnu.org
2023-08-03 23:06 ` johelegp at gmail dot com
2024-02-16  0:20 ` nshead at gcc dot gnu.org
2024-02-16  0:27 ` nshead at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110894-4-bDkUhnNINX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).