Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-07 Thread Ismail Pazarbasi via cfe-commits
ismailp added inline comments. Comment at: test/CodeGenCXX/cxx1z-constexpr-if.cpp:2 @@ -1,2 +1,3 @@ // RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - | FileCheck %s --implicit-check-not=should_not_be_used +// RUN: %clang_cc1 -std=c++1z %s -DCHECK_CONVERSION -verify %s

Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-07 Thread Ismail Pazarbasi via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL280838: Try contextually converting condition of constexpr if to Boolean value (authored by ismailp). Changed prior to commit: https://reviews.llvm.org/D24158?vs=70561=70577#toc Repository: rL LLVM

Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-07 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: test/CodeGenCXX/cxx1z-constexpr-if.cpp:2 @@ -1,2 +1,3 @@ // RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - | FileCheck %s --implicit-check-not=should_not_be_used +// RUN: %clang_cc1 -std=c++1z %s -DCHECK_CONVERSION -verify %s

Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-07 Thread Ismail Pazarbasi via cfe-commits
ismailp added a comment. Thank you for reviewing. Sure, I'll try to look into those conversions as well. Comment at: test/CodeGenCXX/cxx1z-constexpr-if.cpp:2 @@ -1,2 +1,3 @@ // RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - | FileCheck %s

Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-07 Thread Ismail Pazarbasi via cfe-commits
ismailp updated this revision to Diff 70561. ismailp added a comment. - Added more tests https://reviews.llvm.org/D24158 Files: lib/Sema/SemaOverload.cpp test/CodeGenCXX/cxx1z-constexpr-if.cpp Index: test/CodeGenCXX/cxx1z-constexpr-if.cpp

Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-06 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: test/CodeGenCXX/cxx1z-constexpr-if.cpp:26-29 @@ -17,2 +25,6 @@ } + if constexpr (A()) +should_be_used_3(); + else +should_not_be_used(); } Please also add a test that we reject expressions that are

Re: [PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-06 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Thanks, LGTM. If you're looking for more issues in this area -- in passing I noticed that we fail to apply the "contextually converted constant expression of type bool" rules properly in the

[PATCH] D24158: Try contextually converting condition of constexpr if to Boolean value

2016-09-01 Thread Ismail Pazarbasi via cfe-commits
ismailp created this revision. ismailp added a reviewer: rsmith. ismailp added a subscriber: cfe-commits. C++1z 6.4.1/p2: If the if statement is of the form if constexpr, the value of the condition shall be a contextually converted constant expression of type bool [...] C++1z 5.20/p4: [...] A