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
This commit is contained in:
Paolo Carlini 2014-03-04 10:52:18 +00:00 committed by Paolo Carlini
parent 79bc1d65f1
commit 064fd5a8d0
6 changed files with 40 additions and 51 deletions

View File

@ -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

View File

@ -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

View File

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

View File

@ -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" }
}

View File

@ -1,3 +1,9 @@
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.
2014-02-26 Tim Shen <timshen91@gmail.com>
* include/bits/regex.tcc (match_results<>::format,

View File

@ -121,50 +121,3 @@ void test01()
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 72 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 73 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 75 }
// { dg-error "declared" "" { target *-*-* } 26 }
// { dg-error "declared" "" { target *-*-* } 27 }
// { dg-error "declared" "" { target *-*-* } 28 }
// { dg-error "declared" "" { target *-*-* } 29 }
// { dg-error "declared" "" { target *-*-* } 30 }
// { dg-error "declared" "" { target *-*-* } 31 }
// { dg-error "declared" "" { target *-*-* } 32 }
// { dg-error "declared" "" { target *-*-* } 34 }
// { dg-error "declared" "" { target *-*-* } 36 }
// { dg-error "declared" "" { target *-*-* } 37 }
// { dg-error "declared" "" { target *-*-* } 38 }
// { dg-error "declared" "" { target *-*-* } 39 }
// { dg-error "declared" "" { target *-*-* } 40 }
// { dg-error "declared" "" { target *-*-* } 41 }
// { dg-error "declared" "" { target *-*-* } 42 }
// { dg-error "declared" "" { target *-*-* } 43 }
// { dg-error "declared" "" { target *-*-* } 44 }
// { dg-error "declared" "" { target *-*-* } 45 }
// { dg-error "declared" "" { target *-*-* } 46 }
// { dg-error "declared" "" { target *-*-* } 47 }
// { dg-error "declared" "" { target *-*-* } 48 }
// { dg-error "declared" "" { target *-*-* } 49 }
// { dg-error "declared" "" { target *-*-* } 50 }
// { dg-error "declared" "" { target *-*-* } 52 }
// { dg-error "declared" "" { target *-*-* } 53 }
// { dg-error "declared" "" { target *-*-* } 54 }
// { dg-error "declared" "" { target *-*-* } 55 }
// { dg-error "declared" "" { target *-*-* } 56 }
// { dg-error "declared" "" { target *-*-* } 57 }
// { dg-error "declared" "" { target *-*-* } 58 }
// { dg-error "declared" "" { target *-*-* } 59 }
// { dg-error "declared" "" { target *-*-* } 60 }
// { dg-error "declared" "" { target *-*-* } 61 }
// { dg-error "declared" "" { target *-*-* } 62 }
// { dg-error "declared" "" { target *-*-* } 63 }
// { dg-error "declared" "" { target *-*-* } 64 }
// { dg-error "declared" "" { target *-*-* } 65 }
// { dg-error "declared" "" { target *-*-* } 66 }
// { dg-error "declared" "" { target *-*-* } 67 }
// { dg-error "declared" "" { target *-*-* } 68 }
// { dg-error "declared" "" { target *-*-* } 69 }
// { dg-error "declared" "" { target *-*-* } 70 }
// { dg-error "declared" "" { target *-*-* } 71 }
// { dg-error "declared" "" { target *-*-* } 72 }
// { dg-error "declared" "" { target *-*-* } 73 }
// { dg-error "declared" "" { target *-*-* } 75 }