brintos

brintos / llvm-project-archived public Read only

0
0
Text · 911 B · c51483b Raw
65 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: split-file %s %t4 5// RUN: %clang_cc1 -emit-obj -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %t/merge.cpp -o %t/merge.o6 7//--- V.h8#ifndef V_H9#define V_H10template <typename T>11struct V {12  ~V() {}13};14#endif15 16//--- A.h17#include "V.h"18 19void A(const V<unsigned long> &v);20 21//--- B.h22#include "V.h"23 24inline V<unsigned long> B() {25  return {};26}27 28//--- C.h29#include "V.h"30 31#include "A.h"32 33class C {34public:35  C(const V<unsigned long> &v) {36    V<unsigned long> v2;37  }38};39 40C GetC() {41   return {{}};42}43 44// This include *MUST* come last.45#include "B.h"46 47//--- module.modulemap48module "V" { header "V.h" export * }49module "A" { header "A.h" export * }50module "B" { header "B.h" export * }51module "C" { header "C.h" export * }52 53//--- merge.cpp54#include "C.h"55 56template <typename T>57C GetC_main() {58   return {{}};59}60 61void f() {62   GetC_main<float>();63   GetC();64}65