brintos

brintos / llvm-project-archived public Read only

0
0
Text · 879 B · 1d65a37 Raw
38 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: cd %t4//5// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/A.cppm -o %t/A.pcm6// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify7//8// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm -o %t/A.pcm9// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify10//11//--- foo.h12template<typename T, typename U>13inline constexpr bool IsSame = false;14 15template<typename T>16inline constexpr bool IsSame<T, T> = true;17 18template <typename T>19class A {20public:21    A();22    ~A() noexcept(IsSame<T, T>);23};24 25//--- A.cppm26module;27#include "foo.h"28export module A;29export using ::A;30 31//--- Use.cpp32import A;33void bool_consume(bool b);34void use() {35    A<int> a{};36    bool_consume(IsSame); // expected-error {{use of undeclared identifier 'IsSame'}}37}38