diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-21 21:01:48 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-21 21:01:48 +0000 |
| commit | e6856fc10a6d15df0a76eff2da9675935a4cc4d2 (patch) | |
| tree | 452b7f06a7e2bab59e876c65d66faf1091f632ee | |
| parent | 57b9ac90291758cebf03070fc85dc038f5bf3169 (diff) | |
| download | ppe42-gcc-e6856fc10a6d15df0a76eff2da9675935a4cc4d2.tar.gz ppe42-gcc-e6856fc10a6d15df0a76eff2da9675935a4cc4d2.zip | |
PR c++/38597
* name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142868 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/mangle.c | 8 | ||||
| -rw-r--r-- | gcc/cp/name-lookup.c | 1 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/auto13.C | 11 |
5 files changed, 26 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 19af86ccde6..94e1a7cd2c1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2008-12-21 Jason Merrill <jason@redhat.com> + + PR c++/38597 + * name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE. + 2008-12-20 Jakub Jelinek <jakub@redhat.com> Manuel López-Ibáñez <manu@gcc.gnu.org> diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 1ec27c1ffcd..a7b466217eb 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2348,12 +2348,12 @@ write_expression (tree expr) case CAST_EXPR: write_type (TREE_TYPE (expr)); + /* There is no way to mangle a zero-operand cast like + "T()". */ if (!TREE_OPERAND (expr, 0)) - /* "T()" is mangled as "T(void)". */ - write_char ('v'); + sorry ("zero-operand casts cannot be mangled due to a defect " + "in the C++ ABI"); else if (list_length (TREE_OPERAND (expr, 0)) > 1) - /* FIXME the above hack for T() needs to be replaced with - something more general. */ sorry ("mangling function-style cast with more than one argument"); else write_expression (TREE_VALUE (TREE_OPERAND (expr, 0))); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b5d14b3b39c..4c06afdafac 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4701,6 +4701,7 @@ arg_assoc_type (struct arg_lookup *k, tree type) case VECTOR_TYPE: case BOOLEAN_TYPE: case FIXED_POINT_TYPE: + case DECLTYPE_TYPE: return false; case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (type)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 11feb22bd96..88d4c38b89f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-12-21 Jason Merrill <jason@redhat.com> + + PR c++/38597 + * g++.dg/cpp0x/auto13.C: New test. + 2008-12-20 Jakub Jelinek <jakub@redhat.com> Manuel López-Ibáñez <manu@gcc.gnu.org> diff --git a/gcc/testsuite/g++.dg/cpp0x/auto13.C b/gcc/testsuite/g++.dg/cpp0x/auto13.C new file mode 100644 index 00000000000..dc7e35aabaa --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto13.C @@ -0,0 +1,11 @@ +// PR c++/38597 +// { dg-options "-std=c++0x" } + +template<class T, class U> +auto f(T,U) -> decltype(T() + U()) +{ return T() + U(); } + +template<class T> void g(T){} + +int main() { g(f); } // { dg-error "no matching function" } + |

