summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx1z-class-deduction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/cxx1z-class-deduction.cpp')
-rw-r--r--clang/test/CodeGenCXX/cxx1z-class-deduction.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx1z-class-deduction.cpp b/clang/test/CodeGenCXX/cxx1z-class-deduction.cpp
new file mode 100644
index 00000000000..6f8333b13d6
--- /dev/null
+++ b/clang/test/CodeGenCXX/cxx1z-class-deduction.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - | FileCheck %s
+
+template<typename T> struct A {
+ A(T = 0);
+ A(void*);
+};
+
+template<typename T> A(T*) -> A<long>;
+A() -> A<int>;
+
+// CHECK-LABEL: @_Z1fPi(
+void f(int *p) {
+ // CHECK: @_ZN1AIiEC
+ A a{};
+
+ // CHECK: @_ZN1AIlEC
+ A b = p;
+
+ // CHECK: @_ZN1AIxEC
+ A c = 123LL;
+}
OpenPOWER on IntegriCloud