diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2006-09-01 18:10:17 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2006-09-01 18:10:17 +0000 |
commit | 4860b874775e561a48ccc831b23ff3219351a561 (patch) | |
tree | ab34074aaf83251062553222ae454f8524bf7c3d /gcc/testsuite | |
parent | 4832214af7070b43375bf34756334536024acdfb (diff) | |
download | gcc-4860b874775e561a48ccc831b23ff3219351a561.zip gcc-4860b874775e561a48ccc831b23ff3219351a561.tar.gz gcc-4860b874775e561a48ccc831b23ff3219351a561.tar.bz2 |
re PR c++/28705 (ICE: in type_dependent_expression_p, at cp/pt.c:12837)
cp/
PR c++/28705
* semantics.c (finish_call_expr): Add assert.
* name-lookup.c (lookup_arg_dependent): Check we found an overload
or an object.
testsuite/
PR c++/28705
* g++.dg/lookup/koenig5.C: New.
* g++.dg/template/crash56.C: New.
From-SVN: r116638
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/koenig5.C | 46 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash56.C | 16 |
3 files changed, 71 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df6e40f..530c23e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,9 +1,15 @@ +2006-09-01 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/28705 + * g++.dg/lookup/koenig5.C: New. + * g++.dg/template/crash56.C: New. + 2006-09-01 Josh Conner <jconner@apple.com> PR c++/25505 - gcc.dg/nrv3.c: New test. - gcc.dg/nrv4.c: New test. - gcc.dg/nrv5.c: New test. + * gcc.dg/nrv3.c: New test. + * gcc.dg/nrv4.c: New test. + * gcc.dg/nrv5.c: New test. 2006-09-01 Nathan Sidwell <nathan@codesourcery.com> diff --git a/gcc/testsuite/g++.dg/lookup/koenig5.C b/gcc/testsuite/g++.dg/lookup/koenig5.C new file mode 100644 index 0000000..139e3b8 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/koenig5.C @@ -0,0 +1,46 @@ +// Koenig lookup is not defined as intended in the std. DR 218 gives +// an indication of what is meant. This test case encapsulates the +// current conservative behaviour + +// Copyright (C) 2006 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 27 Aug 2006 <nathan@codesourcery.com> + +namespace N +{ + struct A {}; + void One (...); // { dg-error "conflict with" "" } + void (*Two) (...); // { dg-error "not a function" "" } + namespace Three {} // { dg-error "lookup finds|not a function" "" } +} + +namespace M +{ + struct B {}; + struct One {}; // { dg-error "lookup finds|not a function" "" } + void (*Two) (...); // { dg-error "conflict with" "" } + void Three (...); // { dg-error "conflict with" "" } +} + +namespace O +{ + struct C {}; + void Two (...); // { dg-error "conflict with" "" } +} + +void g (N::A *a, M::B *b, O::C *c) +{ + One (a); // ok + One (b); // { dg-error "in call to" "" } + One (a, b); // { dg-error "in call to" "" } + + Two (a); // ok + Two (a, a); // ok + Two (b); // ok + Two (c); // ok + Two (a, b); // { dg-error "in call to" "" } + Two (a, c); // { dg-error "in call to" "" } + + Three (a); // { dg-error "in call to" "" } + Three (b); // ok + Three (a, b); // { dg-error "in call to" "" } +} diff --git a/gcc/testsuite/g++.dg/template/crash56.C b/gcc/testsuite/g++.dg/template/crash56.C new file mode 100644 index 0000000..1efa350 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash56.C @@ -0,0 +1,16 @@ +// Origin: Wolfgang Bangerth <bangerth@dealii.org> + +// PR c++/28705 +// DR 218 is debating whether this is well formed or not. We've never +// accepted it (because we'd crash), so we continue to reject it, but +// without crashing. + +namespace N +{ + struct A { A (A*); }; // { dg-error "lookup finds" "" } +} + +template<typename T> void g (N::A *p) +{ + (void) A (p); // { dg-error "in call" "" } +} |