Re: [cfe-users] inconsistent compilation error inside constexpr if

2020-08-29 Thread Manu agarwal via cfe-users
Thanks Richard and David for your replies. That was helpful. Regards, Manu From: Richard Smith Sent: Sunday, August 23, 2020 11:56 PM To: Manu agarwal Cc: cfe-users@lists.llvm.org Subject: Re: [cfe-users] inconsistent compilation error inside constexpr if On

Re: [cfe-users] inconsistent compilation error inside constexpr if

2020-08-23 Thread Manu agarwal via cfe-users
case it gets evaluated to false? Regards, Manu From: David Blaikie Sent: Saturday, August 22, 2020 2:14 AM To: Manu agarwal Cc: cfe-users@lists.llvm.org Subject: Re: [cfe-users] inconsistent compilation error inside constexpr if >From what I could test on god

Re: [cfe-users] inconsistent compilation error inside constexpr if

2020-08-23 Thread Richard Smith via cfe-users
On Fri, 21 Aug 2020 at 13:29, Manu agarwal via cfe-users < cfe-users@lists.llvm.org> wrote: > Hello, > > In the below code the compiler throws "undeclared identifier" when the > commented line is uncommented. Whereas the line just before compiles fine. > > Regards, > Manu > > typedef bool (* Dummy

Re: [cfe-users] inconsistent compilation error inside constexpr if

2020-08-23 Thread David Blaikie via cfe-users
after template instantiation". But that means code that's invalid no matter what (like "static_assert(false)") still trigger errors. See the latter parts of the constexpr if section here: https://en.cppreference.com/w/cpp/language/if > > Regards, > Manu > > >

Re: [cfe-users] inconsistent compilation error inside constexpr if

2020-08-21 Thread David Blaikie via cfe-users
From what I could test on godbolt, using LLVM evrsions back to 5.0, Clang does reject the "return ClientMain();" call you aren't seeing an error on. So I'm not sure what compiler/version/situation you're running, but at least at first blush it doesn't look like clang. On Fri, Aug 21, 2020 at 1:29

[cfe-users] inconsistent compilation error inside constexpr if

2020-08-21 Thread Manu agarwal via cfe-users
Hello, In the below code the compiler throws "undeclared identifier" when the commented line is uncommented. Whereas the line just before compiles fine. Regards, Manu typedef bool (* DummyFunc) (); bool ExecDummy (DummyFunc fptr) { if (fptr) return fptr (); return false; }