public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted
@ 2012-01-07 16:16 reichelt at gcc dot gnu.org
  2012-01-16 18:14 ` [Bug c++/51786] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2012-01-07 16:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51786

             Bug #: 51786
           Summary: [c++0x] Invalid declaration with decltype accepted
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: reichelt@gcc.gnu.org


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

===================================
struct A {};
void foo() { decltype(A()); }
===================================

It *is* triggered if I write decltype(int) instead.

Another testcase is the following:

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

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

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

This bug is similar to PR21120 where the same problems occured with "typeof".


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-07 13:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07 16:16 [Bug c++/51786] New: [c++0x] Invalid declaration with decltype accepted reichelt at gcc dot gnu.org
2012-01-16 18:14 ` [Bug c++/51786] " paolo.carlini at oracle dot com
2012-01-31 16:25 ` paolo.carlini at oracle dot com
2012-01-31 22:09 ` daniel.kruegler at googlemail dot com
2012-01-31 22:24 ` paolo.carlini at oracle dot com
2012-10-16 10:49 ` paolo.carlini at oracle dot com
2013-07-06 22:49 ` paolo.carlini at oracle dot com
2013-07-07 13:59 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).