This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42687] New: The prevention of ADL with the help of parentheses doesn't work
- From: "max at e-soft dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jan 2010 09:42:26 -0000
- Subject: [Bug c++/42687] New: The prevention of ADL with the help of parentheses doesn't work
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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