public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42687]  New: The prevention of ADL with the help of parentheses doesn't work
@ 2010-01-11  9:42 max at e-soft dot ru
  2010-01-11 18:38 ` [Bug c++/42687] " jwakely dot gcc at gmail dot com
  0 siblings, 1 reply; 4+ messages in thread
From: max at e-soft dot ru @ 2010-01-11  9:42 UTC (permalink / raw)
  To: gcc-bugs

g++ doesn't accept correct code:

namespace N
{
    struct S { };
    void f(const S &) { }
}

void f(const N::S &) { }

int main()
{
    N::S v;
    (f)(v); // no ambiguity: ADL is prevented with (), only ::f is considered
}

--------------------------------------
References:

    1) http://www.josuttis.com/tmplbook/ - "9.2.1 Argument-Dependent Lookup",
page 123.

    2) http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf -
"3.4.2 Argument-dependent name lookup", example on page 46.


-- 
           Summary: The prevention of ADL with the help of parentheses
                    doesn't work
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: max at e-soft dot ru


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


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <bug-42687-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-03-29 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-11  9:42 [Bug c++/42687] New: The prevention of ADL with the help of parentheses doesn't work max at e-soft dot ru
2010-01-11 18:38 ` [Bug c++/42687] " jwakely dot gcc at gmail dot com
     [not found] <bug-42687-4@http.gcc.gnu.org/bugzilla/>
2011-03-29 13:49 ` f.sowade-gcc at r9e dot de
2011-03-29 14:21 ` redi at gcc dot gnu.org

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).