Implement the basic approach for instantiating types, with a lot of FIXME'd
stubs for those types we don't yet know how to instantiate (everything
that isn't a template parameter!).
We now instantiate default arguments for template type parameters when
needed. This will be our testbed while I fill out the remaining
type-instantiation logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiation-default-1.cpp b/test/SemaTemplate/instantiation-default-1.cpp
new file mode 100644
index 0000000..cc616ac
--- /dev/null
+++ b/test/SemaTemplate/instantiation-default-1.cpp
@@ -0,0 +1,19 @@
+// RUN: clang -fsyntax-only -verify %s
+
+template<typename T, typename U = const T> struct Def1;
+
+template<> struct Def1<int> {
+ void foo();
+};
+
+template<> struct Def1<const int> { // expected-note{{previous definition is here}}
+ void bar();
+};
+
+void test_Def1(Def1<int, const int> *d1, Def1<const int, const int> *d2) {
+ d1->foo();
+ d2->bar();
+}
+
+template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1'}}
+