[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / pr27401.cpp
blob8db3bbb0094afbcc5a71e42d3422d84fb14c2a63
1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -std=c++11 -I%S/Inputs/PR27401 -verify %s
3 // RUN: %clang_cc1 -std=c++11 -fmodules -fmodule-map-file=%S/Inputs/PR27401/module.modulemap -fmodules-cache-path=%t -I%S/Inputs/PR27401 -verify %s
4 // RUN: %clang_cc1 -std=c++11 -fmodules -fmodule-map-file=%S/Inputs/PR27401/module.modulemap -fmodules-cache-path=%t -I%S/Inputs/PR27401 -verify %s -triple i686-windows
6 #include "a.h"
7 #define _LIBCPP_VECTOR
8 template <class, class _Allocator>
9 class __vector_base {
10 protected:
11 _Allocator __alloc() const;
12 __vector_base(_Allocator);
15 template <class _Tp, class _Allocator = allocator>
16 class vector : __vector_base<_Tp, _Allocator> {
17 public:
18 vector() noexcept(is_nothrow_default_constructible<_Allocator>::value);
19 vector(const vector &);
20 vector(vector &&)
21 noexcept(is_nothrow_move_constructible<_Allocator>::value);
24 template <class _Tp, class _Allocator>
25 vector<_Tp, _Allocator>::vector(const vector &__x) : __vector_base<_Tp, _Allocator>(__x.__alloc()) {}
27 struct CommentOptions {
28 vector<char> ParseAllComments;
29 CommentOptions() {}
31 struct PrintingPolicy {
32 PrintingPolicy(CommentOptions LO) : LangOpts(LO) {}
33 CommentOptions LangOpts;
36 #include "b.h"
37 CommentOptions fn1() { return fn1(); }
39 // expected-no-diagnostics