aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-04-27 01:17:20 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-04-27 01:17:20 -0400
commita4bd198ceeb0445d62574073a8326312a284a16b (patch)
treed337fd4219b2fd8ae43096e87520722f232b4c5c /gcc/cp
parenta0dc5e4ac9d0263c8c2d2d3f4029212833a26f6a (diff)
downloadgcc-a4bd198ceeb0445d62574073a8326312a284a16b.zip
gcc-a4bd198ceeb0445d62574073a8326312a284a16b.tar.gz
gcc-a4bd198ceeb0445d62574073a8326312a284a16b.tar.bz2
re PR c++/42687 (The prevention of ADL with the help of parentheses doesn't work)
PR c++/42687 * parser.c (cp_parser_primary_expression): Set *idk to CP_ID_KIND_NONE for a parenthesized identifier. From-SVN: r173007
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/parser.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2eabf11..c6e83de 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2011-04-26 Jason Merrill <jason@redhat.com>
+ PR c++/42687
+ * parser.c (cp_parser_primary_expression): Set *idk to
+ CP_ID_KIND_NONE for a parenthesized identifier.
+
* ptree.c (cxx_print_type) [TYPENAME_TYPE]: Dump fullname.
(cxx_print_identifier): Correct indentation.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 6da285e..68ce052 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -3437,6 +3437,12 @@ cp_parser_primary_expression (cp_parser *parser,
`&A::B' might be a pointer-to-member, but `&(A::B)' is
not. */
finish_parenthesized_expr (expr);
+ /* DR 705: Wrapping an unqualified name in parentheses
+ suppresses arg-dependent lookup. We want to pass back
+ CP_ID_KIND_QUALIFIED for suppressing vtable lookup
+ (c++/37862), but none of the others. */
+ if (*idk != CP_ID_KIND_QUALIFIED)
+ *idk = CP_ID_KIND_NONE;
}
/* The `>' token might be the end of a template-id or
template-parameter-list now. */