[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / PCH / cxx-variadic-templates.cpp
blobb1eed5adb647b75a1ed9fb52745af45dd6c4d3a1
1 // Test this without pch.
2 // RUN: %clang_cc1 -std=c++11 -include %S/cxx-variadic-templates.h -verify %s -ast-dump -o -
3 // RUN: %clang_cc1 -std=c++11 -include %S/cxx-variadic-templates.h %s -emit-llvm -o - | FileCheck %s
5 // Test with pch.
6 // RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -o %t %S/cxx-variadic-templates.h
7 // RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s -ast-dump -o -
8 // RUN: %clang_cc1 -std=c++11 -include-pch %t %s -emit-llvm -o - | FileCheck %s
10 // RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -fpch-instantiate-templates -o %t %S/cxx-variadic-templates.h
11 // RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s -ast-dump -o -
12 // RUN: %clang_cc1 -std=c++11 -include-pch %t %s -emit-llvm -o - | FileCheck %s
14 // expected-no-diagnostics
16 // CHECK: allocate_shared
17 shared_ptr<int> spi = shared_ptr<int>::allocate_shared(1, 2);
19 template<int> struct A {};
20 template<int> struct B {};
21 outer<int, int>::inner<1, 2, A, B> i(A<1>{}, B<2>{});
23 void test_nondependent_pack() {
24 take_nondependent_pack<int, int>(nullptr, nullptr);
25 take_nondependent_pack_2<int, int>({});