brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 9ed20e7 Raw
73 lines · plain
1// From https://github.com/llvm/llvm-project/issues/613172// RUN: rm -rf %t3// RUN: mkdir -p %t4// RUN: split-file %s %t5//6// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm7// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm \8// RUN:     -fprebuilt-module-path=%t9// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify10 11// RUN: rm -rf %t12// RUN: mkdir -p %t13// RUN: split-file %s %t14//15// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm16// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -o %t/B.pcm \17// RUN:     -fprebuilt-module-path=%t18// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify19 20//--- foo.h21#ifndef _FOO22#define _FOO23 24template <typename T> struct Foo {25  Foo(T f) {}26};27 28template <typename T> Foo(T&) -> Foo<T>;29 30struct Bar {31  template <typename T>32    requires requires { Foo{T()}; }33  void baz() const {}34};35 36template <typename T> struct Foo2 {37  Foo2(T f) {}38};39 40struct Bar2 {41  template <typename T>42    requires requires { Foo2{T()}; }43  void baz2() const {}44};45 46#endif47 48//--- A.cppm49module;50#include "foo.h"51export module A;52export using ::Foo;53export using ::Bar;54export using ::Bar2;55 56//--- B.cppm57module;58#include "foo.h"59export module B;60export import A;61 62//--- Use.cpp63// expected-no-diagnostics64import A;65import B;66void use() {67  Bar _; 68  _.baz<int>();69 70  Bar2 __; 71  __.baz2<int>();72}73