]> granicus.if.org Git - clang/commitdiff
Add test for out-of-line definition of a conversion function
authorDouglas Gregor <dgregor@apple.com>
Fri, 21 Aug 2009 22:23:24 +0000 (22:23 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 21 Aug 2009 22:23:24 +0000 (22:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79679 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp

index 84454900bb5e9885c4f7796388aeff0267cd1f74..79f379aba148611da242e1be91f59623a04828e5 100644 (file)
@@ -17,6 +17,8 @@ public:
   void f3(size_type) const;
   void f4() ;
   
+  operator T*() const;
+  
   T value;
 };
 
@@ -56,3 +58,8 @@ X0<T, U>::X0(int x) : value(x) { }
 template<typename T, typename U>
 X0<T, U>::~X0() { }
 
+// Test out-of-line conversion functions.
+template<typename T, typename U>
+X0<T, U>::operator T*() const {
+  return &value;
+}