summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/explicit-instantiation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/explicit-instantiation.cpp')
-rw-r--r--clang/test/CodeGenCXX/explicit-instantiation.cpp12
1 files changed, 9 insertions, 3 deletions
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<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>;
OpenPOWER on IntegriCloud