summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/cxx11-inheriting-ctors.cpp
blob: 79f78ba6c12623d11fed6faae58ba530e2085520 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s

// expected-no-diagnostics

#ifndef HEADER_INCLUDED
#define HEADER_INCLUDED

struct Base {
  Base(int) {}

  template <typename T>
  Base(T) {}
};

struct Test : Base {
  using Base::Base;
};

template <typename T>
struct Test2 : Base {
  using Base::Base;
};

template <typename B>
struct Test3 : B {
  using B::B;
};

#else

Test test1a(42);
Test test1b(nullptr);
Test2<int> test2a(42);
Test2<int> test2b(nullptr);
Test3<Base> test3a(42);
Test3<Base> test3b(nullptr);

#endif // HEADER_INCLUDED
OpenPOWER on IntegriCloud