brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1022 B · 09c6b1f Raw
41 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#endif19namespace ns {20template <typename G> static void func() {}21template <> INLINE void func<long>() {}22template <typename T = long> void a() { func<T>(); }23}24 25//--- a.cppm26module;27#include "a.h"28export module a;29export using ns::a;30 31//--- test.cc32import a;33auto m = (a(), 0);34 35#ifdef TEST_INLINE36// expected-no-diagnostics37#else38// expected-error@a.h:9 {{no matching function for call to 'func'}}39// expected-note@test.cc:2 {{in instantiation of function template specialization 'ns::a<long>' requested here}}40#endif41