diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2007-07-22 18:46:51 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2007-07-22 18:46:51 +0000 |
commit | 823c22f9eacdc9b5519a561eb2506d32fab41b37 (patch) | |
tree | 023599cfcc1f7ed7a4850379b0fc219cd48e8482 /gcc/testsuite | |
parent | eec14ce5ec901fc2bab2cc8b25b5ec6c8f9ce3d5 (diff) | |
download | gcc-823c22f9eacdc9b5519a561eb2506d32fab41b37.zip gcc-823c22f9eacdc9b5519a561eb2506d32fab41b37.tar.gz gcc-823c22f9eacdc9b5519a561eb2506d32fab41b37.tar.bz2 |
re PR c++/32839 (internal compiler error: Segmentation fault (templates))
cp/
PR c++/32839
* typeck.c (convert_arguments): Only use default args if we have
a function decl.
testsuite/
PR c++/32839
* g++.dg/expr/call4.C: New.
* g++.dg/expr/call5.C: New.
From-SVN: r126829
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/expr/call4.C | 27 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/expr/call5.C | 19 |
3 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 17989ac..2cf110b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-07-22 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/32839 + * g++.dg/expr/call4.C: New. + * g++.dg/expr/call5.C: New. + 2007-07-22 Daniel Franke <franke.daniel@gmail.com> PR fortran/32710 diff --git a/gcc/testsuite/g++.dg/expr/call4.C b/gcc/testsuite/g++.dg/expr/call4.C new file mode 100644 index 0000000..b4f2d60 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/call4.C @@ -0,0 +1,27 @@ +// { dg-do compile } + +// Copyright (C) 2007 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Jul 2007 <nathan@codesourcery.com> + +// Origin: Danny Boelens <danny.boelens@artwork-systems.com> +// PR 32839. Default arguments propagated through the type system to +// an indirect call. + +template<typename T> +struct TPL +{ + enum Whatever {e1, e2}; + + static void Quux (int i = e1 | e2); +}; + +template <typename F> +void DoIt (F fun) +{ + fun (); // { dg-error "too few arguments" } +} + +void Foo () +{ + DoIt (&TPL<int>::Quux); +} diff --git a/gcc/testsuite/g++.dg/expr/call5.C b/gcc/testsuite/g++.dg/expr/call5.C new file mode 100644 index 0000000..023ad81 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/call5.C @@ -0,0 +1,19 @@ +// { dg-do compile } + +// Copyright (C) 2007 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Jul 2007 <nathan@codesourcery.com> + +// PR 32839. Default arguments propagated through the type system to +// an indirect call. + +void Quux (int i = 0); +void Baz (int i); + +void Foo () +{ + __typeof (Quux) *q = Baz; + + q (); // { dg-error "too few arguments" } +} + + |