From 34ec2ef159c0d712ee66364228bd16dbe7f5e390 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 4 Sep 2009 22:48:11 +0000 Subject: 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 --- clang/test/CodeGenCXX/explicit-instantiation.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'clang/test') diff --git a/clang/test/CodeGenCXX/explicit-instantiation.cpp b/clang/test/CodeGenCXX/explicit-instantiation.cpp index 38966aad2de..33cbf7f872e 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 struct plus { - Result operator()(const T& t, const U& u) const { - return t + u; - } + Result operator()(const T& t, const U& u) const; }; +template +Result plus::operator()(const T& t, const U& u) const { + return t + u; +} + template struct plus; -- cgit v1.2.3