summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang Fan <xiangfan@microsoft.com>2017-05-24 15:51:38 -0700
committerJan Kotas <jkotas@microsoft.com>2017-05-24 15:51:38 -0700
commit0ad57d9177ac88aabbf9354b985c5ac192a307e7 (patch)
tree0d125e197cda4a2e9183073f34b2afb9532debfb
parentf853a04ea9c80bf63419a07fe3fe2fefb23d25aa (diff)
downloadcoreclr-0ad57d9177ac88aabbf9354b985c5ac192a307e7.tar.gz
coreclr-0ad57d9177ac88aabbf9354b985c5ac192a307e7.tar.bz2
coreclr-0ad57d9177ac88aabbf9354b985c5ac192a307e7.zip
Fix Issue 11861 (#11886)
* Fix issues exposed by building with MSVC and /permissive-. Using full-qualified name to declare members inside class is ill-formed and incorrectly allowed by MSVC. MSVC now gives error when /permissive- is used. * Add a forward declaration for SafeAddRef from utilcode.h. SafeAddRef in holder.h calls SafeAddRef in utilcode.h. The latter hasn't been declared yet, so it isn't a valid candidate during overload resolution. It happens to work in MSVC default mode because of the lack of two phase name lookup.
-rw-r--r--src/inc/holder.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/inc/holder.h b/src/inc/holder.h
index a92eeabaab..299056b121 100644
--- a/src/inc/holder.h
+++ b/src/inc/holder.h
@@ -1449,6 +1449,14 @@ class DacHolder
// Holder-specific clr::SafeAddRef and clr::SafeRelease helper functions.
namespace clr
{
+ // Copied from utilcode.h. We can't include the header directly because there
+ // is circular reference.
+ // Forward declare the overload which is used by 'SafeAddRef' below.
+ template <typename ItfT>
+ static inline
+ typename std::enable_if< std::is_pointer<ItfT>::value, ItfT >::type
+ SafeAddRef(ItfT pItf);
+
template < typename ItfT > __checkReturn
ItfT *
SafeAddRef(ReleaseHolder<ItfT> & pItf)