Re: r288089 - Avoid lambdas in default member initializers to work around clang bug

2016-12-06 Thread Benjamin Kramer via cfe-commits
Leaving it as it is now is fine with me.

On Tue, Dec 6, 2016 at 8:38 PM, Reid Kleckner  wrote:
> This can be reverted now that PR31197 is fixed. I kind of like the new code
> better, so up to you, Benjamin.
>
> On Mon, Nov 28, 2016 at 3:58 PM, Reid Kleckner via cfe-commits
>  wrote:
>>
>> Author: rnk
>> Date: Mon Nov 28 17:58:04 2016
>> New Revision: 288089
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=288089=rev
>> Log:
>> Avoid lambdas in default member initializers to work around clang bug
>>
>> On Windows, Clang is mangling lambdas in default member initializers
>> incorrectly. See PR31197.
>>
>> This is causing redness on the self-host bots. Work around the problem
>> locally so we aren't blind to further issues.
>>
>> Modified:
>> cfe/trunk/unittests/Tooling/LookupTest.cpp
>>
>> Modified: cfe/trunk/unittests/Tooling/LookupTest.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/LookupTest.cpp?rev=288089=288088=288089=diff
>>
>> ==
>> --- cfe/trunk/unittests/Tooling/LookupTest.cpp (original)
>> +++ cfe/trunk/unittests/Tooling/LookupTest.cpp Mon Nov 28 17:58:04 2016
>> @@ -13,18 +13,19 @@ using namespace clang;
>>
>>  namespace {
>>  struct GetDeclsVisitor : TestVisitor {
>> -  std::function OnCall = [&](CallExpr *Expr) {};
>> -  std::function OnRecordTypeLoc = [&](RecordTypeLoc
>> Type) {
>> -  };
>> +  std::function OnCall;
>> +  std::function OnRecordTypeLoc;
>>SmallVector DeclStack;
>>
>>bool VisitCallExpr(CallExpr *Expr) {
>> -OnCall(Expr);
>> +if (OnCall)
>> +  OnCall(Expr);
>>  return true;
>>}
>>
>>bool VisitRecordTypeLoc(RecordTypeLoc Loc) {
>> -OnRecordTypeLoc(Loc);
>> +if (OnRecordTypeLoc)
>> +  OnRecordTypeLoc(Loc);
>>  return true;
>>}
>>
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r288089 - Avoid lambdas in default member initializers to work around clang bug

2016-12-06 Thread Reid Kleckner via cfe-commits
This can be reverted now that PR31197 is fixed. I kind of like the new code
better, so up to you, Benjamin.

On Mon, Nov 28, 2016 at 3:58 PM, Reid Kleckner via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: rnk
> Date: Mon Nov 28 17:58:04 2016
> New Revision: 288089
>
> URL: http://llvm.org/viewvc/llvm-project?rev=288089=rev
> Log:
> Avoid lambdas in default member initializers to work around clang bug
>
> On Windows, Clang is mangling lambdas in default member initializers
> incorrectly. See PR31197.
>
> This is causing redness on the self-host bots. Work around the problem
> locally so we aren't blind to further issues.
>
> Modified:
> cfe/trunk/unittests/Tooling/LookupTest.cpp
>
> Modified: cfe/trunk/unittests/Tooling/LookupTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/
> Tooling/LookupTest.cpp?rev=288089=288088=288089=diff
> 
> ==
> --- cfe/trunk/unittests/Tooling/LookupTest.cpp (original)
> +++ cfe/trunk/unittests/Tooling/LookupTest.cpp Mon Nov 28 17:58:04 2016
> @@ -13,18 +13,19 @@ using namespace clang;
>
>  namespace {
>  struct GetDeclsVisitor : TestVisitor {
> -  std::function OnCall = [&](CallExpr *Expr) {};
> -  std::function OnRecordTypeLoc = [&](RecordTypeLoc
> Type) {
> -  };
> +  std::function OnCall;
> +  std::function OnRecordTypeLoc;
>SmallVector DeclStack;
>
>bool VisitCallExpr(CallExpr *Expr) {
> -OnCall(Expr);
> +if (OnCall)
> +  OnCall(Expr);
>  return true;
>}
>
>bool VisitRecordTypeLoc(RecordTypeLoc Loc) {
> -OnRecordTypeLoc(Loc);
> +if (OnRecordTypeLoc)
> +  OnRecordTypeLoc(Loc);
>  return true;
>}
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r288089 - Avoid lambdas in default member initializers to work around clang bug

2016-11-28 Thread Reid Kleckner via cfe-commits
Author: rnk
Date: Mon Nov 28 17:58:04 2016
New Revision: 288089

URL: http://llvm.org/viewvc/llvm-project?rev=288089=rev
Log:
Avoid lambdas in default member initializers to work around clang bug

On Windows, Clang is mangling lambdas in default member initializers
incorrectly. See PR31197.

This is causing redness on the self-host bots. Work around the problem
locally so we aren't blind to further issues.

Modified:
cfe/trunk/unittests/Tooling/LookupTest.cpp

Modified: cfe/trunk/unittests/Tooling/LookupTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/LookupTest.cpp?rev=288089=288088=288089=diff
==
--- cfe/trunk/unittests/Tooling/LookupTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/LookupTest.cpp Mon Nov 28 17:58:04 2016
@@ -13,18 +13,19 @@ using namespace clang;
 
 namespace {
 struct GetDeclsVisitor : TestVisitor {
-  std::function OnCall = [&](CallExpr *Expr) {};
-  std::function OnRecordTypeLoc = [&](RecordTypeLoc Type) 
{
-  };
+  std::function OnCall;
+  std::function OnRecordTypeLoc;
   SmallVector DeclStack;
 
   bool VisitCallExpr(CallExpr *Expr) {
-OnCall(Expr);
+if (OnCall)
+  OnCall(Expr);
 return true;
   }
 
   bool VisitRecordTypeLoc(RecordTypeLoc Loc) {
-OnRecordTypeLoc(Loc);
+if (OnRecordTypeLoc)
+  OnRecordTypeLoc(Loc);
 return true;
   }
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits