diff options
author | Phil Christensen <philc@microsoft.com> | 2016-10-28 02:09:35 -0700 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-10-28 11:09:35 +0200 |
commit | 8877516062414f770f6c97272c4fad43296202f6 (patch) | |
tree | 4347c3c8b6d8fd191dc71b8826f18798d4cbaee2 /src/md | |
parent | c4d899414fc9af1a22b9b38748d53b3e6e5eeb2b (diff) | |
download | coreclr-8877516062414f770f6c97272c4fad43296202f6.tar.gz coreclr-8877516062414f770f6c97272c4fad43296202f6.tar.bz2 coreclr-8877516062414f770f6c97272c4fad43296202f6.zip |
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 <class T> struct B {
void f();
};
template <class T> struct D
: public B<T> //B is a dependent base because its type depends on the type of T in D<T>.
{
//One possible fix is to uncomment the following line. If this
//were a type we should have 'using typename'...
//using B<T>::f;
void g() {
f(); //Error: identifier not found, one possible fix is change it to 'this->f();'
}
};
void h()
{
D<int> 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
Diffstat (limited to 'src/md')
-rw-r--r-- | src/md/winmd/inc/adapter.h | 2 |
1 files changed, 1 insertions, 1 deletions
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( |