1// RUN: rm -rf %t 2// RUN: split-file %s %t 3// RUN: cd %t 4// 5// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/A.cppm -o %t/A.pcm 6// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify 7// 8//--- foo.h 9template<typename T, typename U> 10inline constexpr bool IsSame = false; 11 12template<typename T> 13inline constexpr bool IsSame<T, T> = true; 14 15template <typename T> 16class A { 17public: 18 A(); 19 ~A() noexcept(IsSame<T, T>); 20}; 21 22//--- A.cppm 23module; 24#include "foo.h" 25export module A; 26export using ::A; 27 28//--- Use.cpp 29import A; 30void bool_consume(bool b); 31void use() { 32 A<int> a{}; 33 bool_consume(IsSame); // expected-error {{use of undeclared identifier 'IsSame'}} 34} 35