diff options
author | Marek Polacek <polacek@redhat.com> | 2019-02-27 19:07:18 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-02-27 19:07:18 +0000 |
commit | 867a4ad28e118776bedc3bb2571d91c898aa3398 (patch) | |
tree | 0d568ea85489f61ec8f75d64251330a09338dbfb /gcc/cp/parser.c | |
parent | ec3029103841b4298baff9adc37bfa7d357bdbe3 (diff) | |
download | gcc-867a4ad28e118776bedc3bb2571d91c898aa3398.zip gcc-867a4ad28e118776bedc3bb2571d91c898aa3398.tar.gz gcc-867a4ad28e118776bedc3bb2571d91c898aa3398.tar.bz2 |
PR c++/89511 - ICE with using-declaration and unscoped enumerator.
* parser.c (cp_parser_using_declaration): For an unscoped enum
only use its context if it's not a function declaration.
* g++.dg/cpp0x/using-enum-3.C: New test.
From-SVN: r269262
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d9824e4..5f69403 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -19412,7 +19412,8 @@ cp_parser_using_declaration (cp_parser* parser, /*is_declaration=*/true); if (!qscope) qscope = global_namespace; - else if (UNSCOPED_ENUM_P (qscope)) + else if (UNSCOPED_ENUM_P (qscope) + && !TYPE_FUNCTION_SCOPE_P (qscope)) qscope = CP_TYPE_CONTEXT (qscope); if (access_declaration_p && cp_parser_error_occurred (parser)) |