From e08aee866ba3b21eda96e8d33f9d2de5e8a44c64 Mon Sep 17 00:00:00 2001 From: Yuriy Solodkyy Date: Wed, 15 Mar 2017 21:55:53 -0700 Subject: [PATCH] Minor fix to address ?: VC conformance improvement. (dotnet/coreclr#10208) Visual C++ has made some conformance changes to conditional operator that will be available under /permissive- and which make the inference of result type of the conditional operator in these 2 places ambiguous. This happens because the class type in one of the arguments provides both: the constructor from and the conversion operator to T - LCWSTR here. Commit migrated from https://github.com/dotnet/coreclr/commit/67f40646d76d914ab7f099df25768c73c4f55bad --- src/coreclr/src/vm/dwreport.cpp | 2 +- src/coreclr/src/vm/eventreporter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/dwreport.cpp b/src/coreclr/src/vm/dwreport.cpp index 95d7172..b95c59f 100644 --- a/src/coreclr/src/vm/dwreport.cpp +++ b/src/coreclr/src/vm/dwreport.cpp @@ -2468,7 +2468,7 @@ FaultReportResult DoFaultReportWorker( // Was Watson attempted, successful? { // Look for final '\' pName = wcsrchr(buf, W('\\')); // If found, skip it; if not, point to full name. - pName = pName ? pName+1 : buf; + pName = pName ? pName+1 : (LPCWSTR)buf; } } diff --git a/src/coreclr/src/vm/eventreporter.cpp b/src/coreclr/src/vm/eventreporter.cpp index a96c525..c73af36 100644 --- a/src/coreclr/src/vm/eventreporter.cpp +++ b/src/coreclr/src/vm/eventreporter.cpp @@ -64,7 +64,7 @@ EventReporter::EventReporter(EventReporterType type) { // If app name has a '\', consider the part after that; otherwise consider whole name. LPCWSTR appName = wcsrchr(appPath, W('\\')); - appName = appName ? appName+1 : appPath; + appName = appName ? appName+1 : (LPCWSTR)appPath; m_Description.Append(appName); m_Description.Append(W("\n")); } -- 2.7.4