Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation
declaration and an explicit instantiation definition, and know not to
instantiate explicit instantiation declarations. Unfortunately, there
is some remaining confusion w.r.t. instantiation of out-of-line member
function definitions that causes trouble here.
 

llvm-svn: 81053
diff --git a/clang/test/CodeGenCXX/explicit-instantiation.cpp b/clang/test/CodeGenCXX/explicit-instantiation.cpp
index 38966aa..33cbf7f 100644
--- a/clang/test/CodeGenCXX/explicit-instantiation.cpp
+++ b/clang/test/CodeGenCXX/explicit-instantiation.cpp
@@ -1,11 +1,17 @@
 // RUN: clang-cc -emit-llvm -femit-all-decls -o %t %s &&
 // RUN: grep "_ZNK4plusIillEclERKiRKl" %t | count 1
 
+// FIXME: We should not need the -femit-all-decls, because operator() should
+// be emitted as an external symbol rather than with linkonce_odr linkage.
+// This is a Sema problem.
 template<typename T, typename U, typename Result>
 struct plus {
-  Result operator()(const T& t, const U& u) const {
-    return t + u;
-  }
+  Result operator()(const T& t, const U& u) const;
 };
 
+template<typename T, typename U, typename Result>
+Result plus<T, U, Result>::operator()(const T& t, const U& u) const {
+  return t + u;
+}
+
 template struct plus<int, long, long>;