fix CoreCLR build errors with clang5.0. (#15477)
authorSergey Andreenko <seandree@microsoft.com>
Tue, 12 Dec 2017 03:05:15 +0000 (19:05 -0800)
committerGitHub <noreply@github.com>
Tue, 12 Dec 2017 03:05:15 +0000 (19:05 -0800)
* spmi: delete the explicit call to the constructor.

MethodContext was already initialized through `new MethodContext();`

* add an artificial using of lambda param.

the define `#define PAL_EXCEPT(dispositionExpression)`
can declare expression that has zero or one param. If it has zero param, then `__param` in the lambda is unused, prevent clang complains by adding this change.

src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
src/pal/inc/pal.h

index 581b228..601f738 100644 (file)
@@ -299,8 +299,6 @@ void MethodContext::MethodInitHelperFile(HANDLE hFile)
 
 void MethodContext::MethodInitHelper(unsigned char* buff2, unsigned int totalLen)
 {
-    MethodContext::MethodContext();
-
     unsigned int   buffIndex = 0;
     unsigned int   localsize = 0;
     unsigned char  canary    = 0xff;
index 8f6bc12..e8fdab5 100644 (file)
@@ -5921,6 +5921,7 @@ public:
     EXCEPTION_DISPOSITION disposition = EXCEPTION_CONTINUE_EXECUTION;           \
     auto exceptionFilter = [&disposition, &__param](PAL_SEHException& ex)       \
     {                                                                           \
+        (void)__param;                                                          \
         disposition = dispositionExpression;                                    \
         _ASSERTE(disposition != EXCEPTION_CONTINUE_EXECUTION);                  \
         return disposition;                                                     \