xref: /llvm-project/clang/test/Modules/predefined.cpp (revision da00c60dae0040185dc45039c4397f6e746548e9)
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
4 
5 // RUN: %clang_cc1 -x c++ -std=c++20 -emit-module-interface a.h -o a.pcm -fms-extensions -verify
6 // RUN: %clang_cc1 -std=c++20 a.cpp -fmodule-file=A=a.pcm -fms-extensions -fsyntax-only -verify
7 
8 // RUN: %clang_cc1 -x c++ -std=c++20 -emit-reduced-module-interface a.h -o a.pcm -fms-extensions -verify
9 // RUN: %clang_cc1 -std=c++20 a.cpp -fmodule-file=A=a.pcm -fms-extensions -fsyntax-only -verify
10 
11 //--- a.h
12 
13 // expected-no-diagnostics
14 
15 export module A;
16 
17 export template <typename T>
f()18 void f() {
19     char a[] = __func__;
20 }
21 
22 //--- a.cpp
23 
24 // expected-warning@a.h:8 {{initializing an array from a '__func__' predefined identifier is a Microsoft extension}}
25 
26 import A;
27 
g()28 void g() {
29     f<int>(); // expected-note {{in instantiation of function template specialization 'f<int>' requested here}}
30 }
31