Implement the C++0x deduced 'auto' feature.

This fixes PR 8738, 9060 and 9132.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126069 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/dependent-auto.cpp b/test/SemaCXX/dependent-auto.cpp
new file mode 100644
index 0000000..0ea5948
--- /dev/null
+++ b/test/SemaCXX/dependent-auto.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
+
+template<typename T>
+struct only {
+  only(T);
+  template<typename U> only(U) = delete; // expected-note {{here}}
+};
+
+template<typename ...T>
+void f(T ...t) {
+  auto x(t...); // expected-error {{requires an initializer}} expected-error {{contains multiple expressions}}
+  only<int> check = x;
+}
+
+void g() {
+  f(); // expected-note {{here}}
+  f(0);
+  f(0, 1); // expected-note {{here}}
+}
+
+
+template<typename T>
+bool h(T t) {
+  auto a = t;
+  decltype(a) b;
+  a = a + b;
+
+  auto p = new auto(t);
+
+  only<double*> test = p; // expected-error {{conversion function from 'char *' to 'only<double *>'}}
+  return p;
+}
+
+bool b = h('x'); // expected-note {{here}}