summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-09 19:17:44 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-09 19:17:44 +0000
commit60437620db8efae20e880c3a70933f6e8149dc7c (patch)
tree25e4f211469fcc36ffba57cf477aed2e59d28c0f /clang/test/CXX/expr
parenta18ef6f1f9d2a32519192feedadb7814461db488 (diff)
downloadbcm5719-llvm-60437620db8efae20e880c3a70933f6e8149dc7c.tar.gz
bcm5719-llvm-60437620db8efae20e880c3a70933f6e8149dc7c.zip
[c++1z] P0091R3: Basic support for deducing class template arguments via deduction-guides.
llvm-svn: 294613
Diffstat (limited to 'clang/test/CXX/expr')
-rw-r--r--clang/test/CXX/expr/expr.post/expr.type.conv/p1.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.post/expr.type.conv/p1.cpp b/clang/test/CXX/expr/expr.post/expr.type.conv/p1.cpp
new file mode 100644
index 00000000000..1bdd52c0370
--- /dev/null
+++ b/clang/test/CXX/expr/expr.post/expr.type.conv/p1.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=c++1z -verify %s
+
+template<typename T> struct A {
+ T t, u;
+};
+template<typename T> A(T, T) -> A<T>; // expected-note {{deduced conflicting types for parameter 'T'}}
+template<typename T> A(A<T>) -> A<T>; // expected-note {{requires 1 argument, but 2 were provided}}
+
+A a = A{1, 2};
+A b = A{3, 4.0}; // expected-error {{no viable constructor or deduction guide}}
OpenPOWER on IntegriCloud