62 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/bar.cppm -emit-module-interface -o %t/bar.pcm6// RUN: %clang_cc1 -std=c++20 %t/foo.cc -fmodule-file=bar=%t/bar.pcm -fsyntax-only -verify7// RUN: %clang_cc1 -std=c++20 %t/bar.cc -fmodule-file=bar=%t/bar.pcm -fsyntax-only -verify8//9// RUN: %clang_cc1 -std=c++20 %t/bar.cppm -emit-reduced-module-interface -o %t/bar.pcm10// RUN: %clang_cc1 -std=c++20 %t/foo.cc -fmodule-file=bar=%t/bar.pcm -fsyntax-only -verify11// RUN: %clang_cc1 -std=c++20 %t/bar.cc -fmodule-file=bar=%t/bar.pcm -fsyntax-only -verify12 13//--- header.h14#pragma once15 16namespace N {17 template<typename T>18 concept X = true;19 20 template<X T>21 class Y {22 public:23 template<X U>24 friend class Y;25 };26 27 inline Y<int> x;28}29 30//--- bar.cppm31module;32 33#include "header.h"34 35export module bar;36 37namespace N {38 // To make sure N::Y won't get elided.39 using N::x;40}41 42//--- foo.cc43// expected-no-diagnostics44#include "header.h"45 46import bar;47 48void y() {49 N::Y<int> y{};50};51 52//--- bar.cc53// expected-no-diagnostics54import bar;55 56#include "header.h"57 58void y() {59 N::Y<int> y{};60};61 62