From 8877516062414f770f6c97272c4fad43296202f6 Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Fri, 28 Oct 2016 02:09:35 -0700 Subject: C++ conformance. (building with /permissive-) (#7855) These issues were found when building with the /permissive- flag in the latest version of MSVC. No tests were added/modified because this does not change any behavior. There are a few types of language conformance issues fixed in this: 1) Strict string conversion (this is also covered by the /Zc:strictStrings flag) The 'const' is not implicitly dropped by string literals, which means the following is not allowed: char str = "const string literal"; //error: cannot convert a 'const char' to a 'char*' This fix to to make str 'const char*'. (This can have a domino effect depending on where str is used) 2) Fully qualified inline declarations members inside class struct A { void A::f() { } // Error: illegal qualified name in member declaration, remove redundant 'A::' to fix }; 3) MSVC by default will allows name lookup in a dependent base. This is disabled by /permissive- template struct B { void f(); }; template struct D : public B //B is a dependent base because its type depends on the type of T in D. { //One possible fix is to uncomment the following line. If this //were a type we should have 'using typename'... //using B::f; void g() { f(); //Error: identifier not found, one possible fix is change it to 'this->f();' } }; void h() { D d; d.g(); } 4) Warning 4800 has been removed in version 19.1 (1910) of the compiler. For backwards compatability, surround the usage of 4800. This is not related to C++ conformance. #if _MSC_VER <= 1900 // 'BOOL' forcing value to bool 'true' or 'false' #pragma warning(disable: 4800) #endif --- src/md/winmd/inc/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/md') diff --git a/src/md/winmd/inc/adapter.h b/src/md/winmd/inc/adapter.h index e69b620938..e42992f81f 100644 --- a/src/md/winmd/inc/adapter.h +++ b/src/md/winmd/inc/adapter.h @@ -136,7 +136,7 @@ public: static BOOL ConvertWellKnownTypeNameFromClrToWinRT(LPCSTR *pszFullName); // Map a well-known CLR typename to WinRT typename - static BOOL WinMDAdapter::ConvertWellKnownTypeNameFromClrToWinRT(LPCSTR *pszNamespace, LPCSTR *pszName); + static BOOL ConvertWellKnownTypeNameFromClrToWinRT(LPCSTR *pszNamespace, LPCSTR *pszName); // Returns names of redirected type 'index'. static void GetRedirectedTypeInfo( -- cgit v1.2.3