diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0335-PR-c-48935.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0335-PR-c-48935.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0335-PR-c-48935.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0335-PR-c-48935.patch new file mode 100644 index 0000000000..05320ac06a --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0335-PR-c-48935.patch | |||
@@ -0,0 +1,76 @@ | |||
1 | From 388aa866785638f2769c4e628fb9e6139d1bdaee Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 25 May 2011 15:26:42 +0000 | ||
4 | Subject: [PATCH] PR c++/48935 | ||
5 | * parser.c (cp_parser_constructor_declarator_p): Don't check | ||
6 | constructor_name_p for enums. | ||
7 | (cp_parser_diagnose_invalid_type_name): Correct error message. | ||
8 | |||
9 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174210 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
10 | |||
11 | index 68c2f88..4c7d9cb 100644 | ||
12 | --- a/gcc/cp/parser.c | ||
13 | +++ b/gcc/cp/parser.c | ||
14 | @@ -2788,7 +2788,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, | ||
15 | "%qT is a dependent scope", | ||
16 | parser->scope, id, parser->scope); | ||
17 | else if (TYPE_P (parser->scope)) | ||
18 | - error_at (location, "%qE in class %qT does not name a type", | ||
19 | + error_at (location, "%qE in %q#T does not name a type", | ||
20 | id, parser->scope); | ||
21 | else | ||
22 | gcc_unreachable (); | ||
23 | @@ -19642,7 +19642,7 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p) | ||
24 | /* If we have a class scope, this is easy; DR 147 says that S::S always | ||
25 | names the constructor, and no other qualified name could. */ | ||
26 | if (constructor_p && nested_name_specifier | ||
27 | - && TYPE_P (nested_name_specifier)) | ||
28 | + && CLASS_TYPE_P (nested_name_specifier)) | ||
29 | { | ||
30 | tree id = cp_parser_unqualified_id (parser, | ||
31 | /*template_keyword_p=*/false, | ||
32 | new file mode 100644 | ||
33 | index 0000000..ebb4868 | ||
34 | --- /dev/null | ||
35 | +++ b/gcc/testsuite/g++.dg/cpp0x/enum16.C | ||
36 | @@ -0,0 +1,6 @@ | ||
37 | +// PR c++/48935 | ||
38 | +// { dg-options -std=c++0x } | ||
39 | + | ||
40 | +enum class ENUM { a }; | ||
41 | + | ||
42 | +ENUM::Type func() { return ENUM::a; } // { dg-error "does not name a type" } | ||
43 | diff --git a/gcc/testsuite/g++.dg/parse/error15.C b/gcc/testsuite/g++.dg/parse/error15.C | ||
44 | index 2352193..607a1db 100644 | ||
45 | --- a/gcc/testsuite/g++.dg/parse/error15.C | ||
46 | +++ b/gcc/testsuite/g++.dg/parse/error15.C | ||
47 | @@ -12,7 +12,7 @@ namespace N | ||
48 | |||
49 | N::A f2; // { dg-error "1:invalid use of template-name 'N::A' without an argument list" } | ||
50 | N::INVALID f3; // { dg-error "1:'INVALID' in namespace 'N' does not name a type" } | ||
51 | -N::C::INVALID f4; // { dg-error "1:'INVALID' in class 'N::C' does not name a type" } | ||
52 | +N::C::INVALID f4; // { dg-error "1:'INVALID' in 'struct N::C' does not name a type" } | ||
53 | N::K f6; // { dg-error "1:'K' in namespace 'N' does not name a type" } | ||
54 | typename N::A f7; | ||
55 | // { dg-error "13:invalid use of template-name 'N::A' without an argument list" "13" { target *-*-* } 17 } | ||
56 | @@ -22,7 +22,7 @@ struct B | ||
57 | { | ||
58 | N::A f2; // { dg-error "3:invalid use of template-name 'N::A' without an argument list" } | ||
59 | N::INVALID f3; // { dg-error "3:'INVALID' in namespace 'N' does not name a type" } | ||
60 | - N::C::INVALID f4; // { dg-error "3:'INVALID' in class 'N::C' does not name a type" } | ||
61 | + N::C::INVALID f4; // { dg-error "3:'INVALID' in 'struct N::C' does not name a type" } | ||
62 | N::K f6; // { dg-error "3:'K' in namespace 'N' does not name a type" } | ||
63 | typename N::A f7; | ||
64 | // { dg-error "15:invalid use of template-name 'N::A' without an argument list" "15" { target *-*-* } 27 } | ||
65 | @@ -33,7 +33,7 @@ struct C | ||
66 | { | ||
67 | N::A f2; // { dg-error "3:invalid use of template-name 'N::A' without an argument list" } | ||
68 | N::INVALID f3; // { dg-error "3:'INVALID' in namespace 'N' does not name a type" } | ||
69 | - N::C::INVALID f4; // { dg-error "3:'INVALID' in class 'N::C' does not name a type" } | ||
70 | + N::C::INVALID f4; // { dg-error "3:'INVALID' in 'struct N::C' does not name a type" } | ||
71 | N::K f6; // { dg-error "3:'K' in namespace 'N' does not name a type" } | ||
72 | typename N::A f7; // { dg-error "15:invalid use of template-name 'N::A' without an argument list" } | ||
73 | }; | ||
74 | -- | ||
75 | 1.7.0.4 | ||
76 | |||