public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113405] New: Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module
@ 2024-01-15 19:41 eddiejnolan at gmail dot com
  2024-01-15 19:51 ` [Bug c++/113405] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: eddiejnolan at gmail dot com @ 2024-01-15 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113405
           Summary: Can't access member type alias of concept-constrained
                    class template specialization in global module
                    fragment via alias template in different module
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eddiejnolan at gmail dot com
  Target Milestone: ---

This example shows GCC failing to resolve the member type alias "foobar" in a
concept-constrained specialization of class template "corge" when it's accessed
from module2 via an alias template in module1.

Compiler explorer link: https://godbolt.org/z/4sh6xG6P4

Minimal reproduction:

// CMakeLists.txt

cmake_minimum_required(VERSION 3.28)
project(repro CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(module1)
target_sources(module1
  PUBLIC
    FILE_SET cxx_modules TYPE CXX_MODULES FILES
   module1.cpp
)
target_include_directories(module1 PRIVATE "include/")

add_library(module2)
target_sources(module2
  PUBLIC
    FILE_SET cxx_modules TYPE CXX_MODULES FILES
   module2.cpp
)
target_link_libraries(module2 PUBLIC module1)

// include/foo.h

template <typename>
concept foo = false;

template <typename>
concept bar = true;

template <typename>
struct corge {};

template <foo T>
struct corge<T> {};

template <bar T>
struct corge<T> {
  using foobar = int;
};

// module1.cpp

module;

#include "foo.h"

export module module1;

export template<class T>
using corge_alias = corge<T>::foobar;

// module2.cpp

export module module2;
import module1;

struct foobaz{};

using quux = corge_alias<foobaz>;

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

end of thread, other threads:[~2024-01-27 10:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-15 19:41 [Bug c++/113405] New: Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module eddiejnolan at gmail dot com
2024-01-15 19:51 ` [Bug c++/113405] " pinskia at gcc dot gnu.org
2024-01-15 21:33 ` eddiejnolan at gmail dot com
2024-01-15 22:20 ` eddiejnolan at gmail dot com
2024-01-19  3:38 ` nathanieloshead at gmail dot com
2024-01-25  3:20 ` cvs-commit at gcc dot gnu.org
2024-01-27 10:19 ` nshead at gcc dot gnu.org

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).