public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52018] New: GCC refuses to accept a disambiguation statement
@ 2012-01-27 12:53 piotr.wyderski at gmail dot com
  2012-01-30  9:24 ` [Bug c++/52018] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: piotr.wyderski at gmail dot com @ 2012-01-27 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52018
           Summary: GCC refuses to accept a disambiguation statement
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: piotr.wyderski@gmail.com


The following code:

class string {};

struct test {

    enum {

       string
    };

    void g(class string&& s) const {}

    template <typename... TA> void mth(TA&&... args) const {

        g(class string{std::forward<TA>(args)...});    
    }
};

compiled using GCC 4.6.1 and 4.6.2 fails:

$ g++ -std=gnu++0x -c test/test.cpp
test/test.cpp: In member function ‘void test::mth(TA&& ...) const’:
test/test.cpp:15:11: error: expected primary-expression before ‘class’

The Holy Book says:

3.4.4: "An elaborated-type-specifier (7.1.6.3) may be used to refer to a
previously declared class-name or enum-name
even though the name has been hidden by a non-type declaration (3.3.10)."

and the problematic statement:

    g(class string{std::forward<TA>(args)...});

looks like a reference.


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

end of thread, other threads:[~2012-01-31 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27 12:53 [Bug c++/52018] New: GCC refuses to accept a disambiguation statement piotr.wyderski at gmail dot com
2012-01-30  9:24 ` [Bug c++/52018] " daniel.kruegler at googlemail dot com
2012-01-31  8:24 ` daniel.kruegler at googlemail dot com
2012-01-31 16:11 ` 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).