[Bug driver/85493] decltype can use deleted constructor and deleted function in template function
ihorelo at mail dot ru
gcc-bugzilla@gcc.gnu.org
Sun Apr 22 12:55:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85493
Ihor Rudynskyi <ihorelo at mail dot ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|decltype can use deleted |decltype can use deleted
|constructor in template |constructor and deleted
|function |function in template
| |function
--- Comment #1 from Ihor Rudynskyi <ihorelo at mail dot ru> ---
also doesn`t work with deleted template function
template<typename...>
int foo() = delete;
template<typename...>
void test()
{
decltype(foo<int>()) a{};
}
int main()
{
test<>();
}(In reply to Ihor Rudynskyi from comment #0)
> decltype can use deleted constructor in template function
>
> struct no_def
> {
> no_def() = delete;
> };
>
> template<typename T>
> void test()
> {
> decltype(no_def()) a{}; // error in Clang and MSVC, no error in GCC
> a = a; // get rid of warning
> }
>
> int main()
> {
> test<int>();
> }
>
>
> Please check
> https://stackoverflow.com/questions/49965849/decltype-with-deleted-
> constructor-is-possible-in-template-function
More information about the Gcc-bugs
mailing list