38 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm \6// RUN: -DTEST_INLINE7// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify \8// RUN: -DTEST_INLINE9//10// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm11// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify12 13//--- a.h14#ifdef TEST_INLINE15#define INLINE inline16#else17#define INLINE18#endif19static INLINE void func(long) {}20template <typename T = long> void a() { func(T{}); }21 22//--- a.cppm23module;24#include "a.h"25export module a;26export using ::a;27 28//--- test.cc29import a;30auto m = (a(), 0);31 32#ifdef TEST_INLINE33// expected-no-diagnostics34#else35// expected-error@a.h:7 {{no matching function for call to 'func'}}36// expected-note@test.cc:2 {{in instantiation of function template specialization 'a<long>' requested here}}37#endif38