[cfe-users] False positive -Wcomma with static_cast of dependent expression

2018-10-18 Thread Mat Sutcliffe via cfe-users
Hello list, The following code generates one false positive of the -Wcomma warning: (tested with clang trunk via Matt Godbolt's Compiler Explorer) template void foo() { (void)42, 0;// ok static_cast(42), 0; // ok (void)T{}, 0; // ok static_cast(T{

Re: [cfe-users] dynmaic_cast in uninstantiated function templates

2018-10-24 Thread Mat Sutcliffe via cfe-users
On Wed, 24 Oct 2018 at 02:06, Olaf wrote: > > the code below compiles on gcc and icc, but not on clang with the error: > > source_file.cpp:14:16: error: 'B' is an incomplete type > if (auto b = dynamic_cast(a)) > > However fn is an uninstantiated function template. > Is this a glitch in clang or