This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug driver/85493] New: decltype can use deleted constructor in template function


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85493

            Bug ID: 85493
           Summary: decltype can use deleted constructor in template
                    function
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ihorelo at mail dot ru
  Target Milestone: ---

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]