diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-03-04 10:52:18 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-03-04 10:52:18 +0000 |
commit | 064fd5a8d077d62dc4c0cf962f2b70b44cdb9a7f (patch) | |
tree | 192d7dcea3be09625fb45140aba73e73b4acf551 /gcc | |
parent | 79bc1d65f12f936b45add06cf243ca00aba2388e (diff) | |
download | gcc-064fd5a8d077d62dc4c0cf962f2b70b44cdb9a7f.zip gcc-064fd5a8d077d62dc4c0cf962f2b70b44cdb9a7f.tar.gz gcc-064fd5a8d077d62dc4c0cf962f2b70b44cdb9a7f.tar.bz2 |
re PR c++/60376 ([c++1y] ICE on invalid with using declaration in template function)
/gcc/cp
2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60376
* parser.c (cp_parser_using_declaration): Early return when
cp_parser_nested_name_specifier errors out.
/gcc/testsuite
2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60376
* g++.dg/cpp1y/pr60376.C: New.
/libstdc++-v3
2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60376
* testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc:
Adjust dg-error directives.
From-SVN: r208309
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/pr60376.C | 12 |
4 files changed, 34 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2d8364b..0a12700 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-03-04 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/60376 + * parser.c (cp_parser_using_declaration): Early return when + cp_parser_nested_name_specifier errors out. + 2014-03-01 Adam Butcher <adam@jessamine.co.uk> PR c++/60377 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8c78262..413ada6 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15932,10 +15932,17 @@ cp_parser_using_declaration (cp_parser* parser, /* If we saw `typename', or didn't see `::', then there must be a nested-name-specifier present. */ if (typename_p || !global_scope_p) - qscope = cp_parser_nested_name_specifier (parser, typename_p, - /*check_dependency_p=*/true, - /*type_p=*/false, - /*is_declaration=*/true); + { + qscope = cp_parser_nested_name_specifier (parser, typename_p, + /*check_dependency_p=*/true, + /*type_p=*/false, + /*is_declaration=*/true); + if (!qscope && !cp_parser_uncommitted_to_tentative_parse_p (parser)) + { + cp_parser_skip_to_end_of_block_or_statement (parser); + return false; + } + } /* Otherwise, we could be in either of the two productions. In that case, treat the nested-name-specifier as optional. */ else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0d9c385..3a683db 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-04 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/60376 + * g++.dg/cpp1y/pr60376.C: New. + 2014-03-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * g++.dg/abi/anon2.C: Don't scan assembler for c++98. diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60376.C b/gcc/testsuite/g++.dg/cpp1y/pr60376.C new file mode 100644 index 0000000..77efdc5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr60376.C @@ -0,0 +1,12 @@ +// PR c++/60376 +// { dg-options -std=c++1y } + +struct A +{ + int foo(); +}; + +template<typename> void bar() +{ + using (A().foo); // { dg-error "expected" } +} |