brintos

brintos / llvm-project-archived public Read only

0
0
Text · 442 B · 542ca27 Raw
21 lines · cpp
1// Tests referencing variable with initializer containing side effect across module boundary2 3// RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -o %t4 5export module Foo;6 7export template <class Float>8struct Wrapper {9  double value;10};11 12export constexpr Wrapper<double> Compute() {13  return Wrapper<double>{1.0};14}15 16export template <typename Float>17Wrapper<Float> ComputeInFloat() {18  const Wrapper<Float> a = Compute();19  return a;20}21