aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
blob: fe1b6a63d75b50093a6a90c8b023f9f8b96d7a07 (plain) (blame)
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
// RUN: %clang_cc1 -verify -std=c++1z %s

namespace Explicit {
  // Each notional constructor is explicit if the function or function template
  // was generated from a constructor or deduction-guide that was declared explicit.
  template<typename T> struct A {
    A(T);
    A(T*);
  };
  template<typename T> A(T) -> A<T>;
  template<typename T> explicit A(T*) -> A<T>; // expected-note {{explicit}}

  int *p;
  A a(p);
  A b = p;
  A c{p};
  A d = {p}; // expected-error {{selected an explicit deduction guide}}

  using X = A<int>;
  using Y = A<int*>;

  using X = decltype(a);
  using Y = decltype(b);
  using X = decltype(c);
}