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

Marcin Nowak <jasio.lpn at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jasio.lpn at gmail dot com

--- Comment #1 from Marcin Nowak <jasio.lpn at gmail dot com> ---
Hi
I wanted to check some new stuff from C++20 so I've compiled GCC 11 form git
and wrote some test app. GCC version:

gcc version 11.0.1 20210407 (experimental) (GCC) 

This is the main.cpp file that I've created:

#include <iostream>
#include <string>

import test;

int main()
{
    std::string str = "Hello";

    std::cout << str << std::endl;
    return 0;
}

And this is the test.cpp:

module;

#include <type_traits>
#include <string>

export module test;

template <typename T>
concept IsStdString = std::is_same_v<T, std::string>;

Command line:
c++ -std=c++20 -fmodules-ts test.cpp main.cpp

Compiler doesn't throw any error but when I'm trying to exec app it gives me an
error:

[1]    71397 segmentation fault (core dumped)  ./a.out

If I remove concept part from test.cpp or move it into main.cpp app is working
fine.
I think it's a bug but it's new stuff in language so maybe I don't understand
something

Best regards

Reply via email to