diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0340-PR-c-46145.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0340-PR-c-46145.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0340-PR-c-46145.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0340-PR-c-46145.patch new file mode 100644 index 0000000000..9fe99c7fc9 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0340-PR-c-46145.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 1f170608081cc8e7a2b1ef2954a5762a04c67af5 Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 25 May 2011 20:30:01 +0000 | ||
4 | Subject: [PATCH] PR c++/46145 | ||
5 | * decl.c (grokdeclarator): Complain about auto typedef. | ||
6 | |||
7 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174235 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
8 | |||
9 | index dbf03f9..cc7a155 100644 | ||
10 | --- a/gcc/cp/decl.c | ||
11 | +++ b/gcc/cp/decl.c | ||
12 | @@ -9304,6 +9304,12 @@ grokdeclarator (const cp_declarator *declarator, | ||
13 | memfn_quals = TYPE_UNQUALIFIED; | ||
14 | } | ||
15 | |||
16 | + if (type_uses_auto (type)) | ||
17 | + { | ||
18 | + error ("typedef declared %<auto%>"); | ||
19 | + type = error_mark_node; | ||
20 | + } | ||
21 | + | ||
22 | if (decl_context == FIELD) | ||
23 | decl = build_lang_decl (TYPE_DECL, unqualified_id, type); | ||
24 | else | ||
25 | index 142ef90..190bfa6 100644 | ||
26 | --- a/gcc/testsuite/g++.dg/cpp0x/auto9.C | ||
27 | +++ b/gcc/testsuite/g++.dg/cpp0x/auto9.C | ||
28 | @@ -119,3 +119,6 @@ H<auto> h; // { dg-error "invalid" } | ||
29 | |||
30 | void qq (auto); // { dg-error "auto" } | ||
31 | void qr (auto*); // { dg-error "auto" } | ||
32 | + | ||
33 | +// PR c++/46145 | ||
34 | +typedef auto autot; // { dg-error "auto" } | ||
35 | -- | ||
36 | 1.7.0.4 | ||
37 | |||