[Bug c++/81506] New: Invalid declaration with decltype accepted

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 21 08:02:00 GMT 2017


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

            Bug ID: 81506
           Summary: Invalid declaration with decltype accepted
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: paolo.carlini at oracle dot com
        Depends on: 51786
  Target Milestone: ---

The error message "declaration does not declare anything" is not
triggered in certain cases when using decltype:

===================================
template<int> struct A
{
  A() { decltype(this); }
};

A<0> a;
===================================

It *is* triggered if I make A a non-template class.

This is actually the second testcase from PR51786. While the first one
was successfully fixed, the second testcase still doesn't work.

Btw, clang produces a warning for this case.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786
[Bug 51786] [c++0x] Invalid declaration with decltype accepted


More information about the Gcc-bugs mailing list