[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::inferFrameworkModule()
[llvm-project.git] / clang / test / SemaTemplate / instantiate-decl-init.cpp
blobf5daa7901fa805546d93985a5212ea67c2a90d1f
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 // PR5426 - the non-dependent obj would be fully processed and wrapped in a
5 // CXXConstructExpr at definition time, which would lead to a failure at
6 // instantiation time.
7 struct arg {
8 arg();
9 };
11 struct oldstylemove {
12 oldstylemove(oldstylemove&);
13 oldstylemove(const arg&);
16 template <typename T>
17 void fn(T t, const arg& arg) {
18 oldstylemove obj(arg);
21 void test() {
22 fn(1, arg());
25 struct X0 { };
27 struct X1 {
28 explicit X1(const X0 &x0 = X0());
31 template<typename T>
32 void f0() {
33 X1 x1;
36 template void f0<int>();
37 template void f0<float>();
39 struct NonTrivial {
40 NonTrivial();
41 ~NonTrivial();
44 template<int N> void f1() {
45 NonTrivial array[N];
47 template<> void f1<2>();
49 namespace PR20346 {
50 struct S { short inner_s; };
52 struct outer_struct {
53 wchar_t arr[32];
54 S outer_s;
57 template <class T>
58 void OpenFileSession() {
59 // Ensure that we don't think the ImplicitValueInitExpr generated here
60 // during the initial parse only initializes the first array element!
61 outer_struct asdfasdf = {};
64 void foo() {
65 OpenFileSession<int>();