brintos

brintos / llvm-project-archived public Read only

0
0
Text · 722 B · e2c796f Raw
40 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/std.cppm -emit-module-interface -o %t/std.pcm6// RUN: %clang_cc1 -std=c++20 %t/mod.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/mod.pcm7// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -verify %t/main.cpp8 9//--- std.cppm10export module std;11 12extern "C++" {13  namespace std {14  export template <class E>15  class initializer_list {16    const E* _1;17    const E* _2;18  };19  }20}21 22//--- mod.cppm23export module mod;24 25import std;26 27export struct A {28  void func(std::initializer_list<int>) {}29};30 31//--- main.cpp32// expected-no-diagnostics33import std;34import mod;35 36int main() {37  A{}.func({1,1});38  return 0;39}40