diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0292-PR-c-48745.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0292-PR-c-48745.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0292-PR-c-48745.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0292-PR-c-48745.patch new file mode 100644 index 0000000000..a8e644ae9c --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0292-PR-c-48745.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From abab8b02e8102ab546f97b60acc3644d1f3bba2a Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Fri, 20 May 2011 19:02:17 +0000 | ||
4 | Subject: [PATCH] PR c++/48745 | ||
5 | * pt.c (value_dependent_expr_p): Handle CONSTRUCTOR. | ||
6 | |||
7 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173972 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
8 | |||
9 | index d49fe6b..d9c7ac4 100644 | ||
10 | --- a/gcc/cp/pt.c | ||
11 | +++ b/gcc/cp/pt.c | ||
12 | @@ -18231,6 +18231,16 @@ value_dependent_expression_p (tree expression) | ||
13 | type-dependent. */ | ||
14 | return type_dependent_expression_p (expression); | ||
15 | |||
16 | + case CONSTRUCTOR: | ||
17 | + { | ||
18 | + unsigned ix; | ||
19 | + tree val; | ||
20 | + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), ix, val) | ||
21 | + if (value_dependent_expression_p (val)) | ||
22 | + return true; | ||
23 | + return false; | ||
24 | + } | ||
25 | + | ||
26 | default: | ||
27 | /* A constant expression is value-dependent if any subexpression is | ||
28 | value-dependent. */ | ||
29 | new file mode 100644 | ||
30 | index 0000000..2b9351a | ||
31 | --- /dev/null | ||
32 | +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae22.C | ||
33 | @@ -0,0 +1,23 @@ | ||
34 | +// PR c++/48745 | ||
35 | +// { dg-options -std=c++0x } | ||
36 | + | ||
37 | +template<class T> | ||
38 | +struct add_rval_ref { | ||
39 | + typedef T&& type; | ||
40 | +}; | ||
41 | + | ||
42 | +template<> | ||
43 | +struct add_rval_ref<void> { | ||
44 | + typedef void type; | ||
45 | +}; | ||
46 | + | ||
47 | +template<class T> | ||
48 | +typename add_rval_ref<T>::type create(); | ||
49 | + | ||
50 | +template<class T, class... Args> | ||
51 | +decltype(T{create<Args>()...}, char()) f(int); | ||
52 | + | ||
53 | +template<class, class...> | ||
54 | +char (&f(...))[2]; | ||
55 | + | ||
56 | +static_assert(sizeof(f<int, void>(0)) != 1, "Error"); // { dg-bogus "void value" "" { xfail *-*-* } } | ||
57 | -- | ||
58 | 1.7.0.4 | ||
59 | |||