[Bug c++/95143] SFINAE failure with static_cast

2020-05-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #13 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:be464161b4ae128681958d94aa460531cf30e0a4

commit r11-459-gbe464161b4ae128681958d94aa460531cf30e0a4
Author: Marek Polacek 
Date:   Mon May 18 13:50:39 2020 -0400

c++: Add test for c++/95143

Already fixed by r10-8124-gceae6a13366d9646e172fc943fe8e221b70f0920.

PR c++/95143
* g++.dg/cpp0x/sfinae66.C: New test.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||mpolacek at gcc dot gnu.org
 Status|NEW |RESOLVED

--- Comment #12 from Richard Biener  ---
Thus fixed.  Adding the testcase might be nice.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #11 from Jonathan Wakely  ---
Possibly fixed as part of PR 94885.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

Jonathan Wakely  changed:

   What|Removed |Added

  Known to fail||10.1.0
   Keywords||needs-bisection,
   ||rejects-valid
 Status|WAITING |NEW
  Known to work||10.1.1, 11.0, 9.2.0

--- Comment #10 from Jonathan Wakely  ---
Thanks. Confirmed as a bug in 10.1 but it already seems to be fixed on the
gcc-10 branch after the release. I'll bisect it.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #9 from Bernd Baumanns  ---
fails with this version:
g++-10.1 (GCC) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #8 from Bernd Baumanns  ---
fails with this version:
g++ (Compiler-Explorer-Build) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiler returned: 0


And this:
g++-10 (Ubuntu 10-20200417-0ubuntu1) 10.0.1 20200417 (experimental) [master
revision a64468a3034:28feadc0609:b835645c7a51b7e99092abe61d677aa491836f95]
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #7 from Bernd Baumanns  ---
I hope you have now all you need.

This bug is only triggered in C++20 mode and with inheritance.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #6 from Bernd Baumanns  ---
simplified source (without include type_traits):

class false_type
{
public:
static constexpr bool value = false;
};

class true_type{
public:
static constexpr bool value = true;
};

template
T&& declval() noexcept;

template
struct is_static_castable : false_type
{};
template
struct is_static_castable(declval()))> :
true_type
{};

class Base
{};

struct A
{};

class B: public Base
{};

int main()
{
constexpr auto canCast = is_static_castable::value;
static_assert(!canCast);
constexpr auto canCast2 = is_static_castable::value;
static_assert(canCast2);
return 0;
}

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #5 from Bernd Baumanns  ---
Created attachment 48544
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48544&action=edit
source

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #4 from Bernd Baumanns  ---
Created attachment 48543
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48543&action=edit
g++-10 -v -save-temps -std=c++2a /mnt/j/test.cpp

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

--- Comment #3 from Bernd Baumanns  ---
Created attachment 48541
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48541&action=edit
ii file

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-05-14
 Status|UNCONFIRMED |WAITING

--- Comment #2 from Jonathan Wakely  ---
Please read https://gcc.gnu.org/bugs (as requested when creating a bug) and
provide the missing information.

[Bug c++/95143] SFINAE failure with static_cast

2020-05-14 Thread familiebaumanns at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95143

Bernd Baumanns  changed:

   What|Removed |Added

URL||https://godbolt.org/z/yVjQf
   ||9

--- Comment #1 from Bernd Baumanns  ---
https://godbolt.org/z/FRznAh