mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-17 18:00:55 +08:00
re PR c++/46105 (Ordering failure among partial specializations with non-deduced context)
PR c++/46105 * typeck.c (structural_comptypes): Ignore cv-quals on typename scope. From-SVN: r179229
This commit is contained in:
parent
15442c9c4f
commit
69d28b4f42
@ -1,5 +1,8 @@
|
||||
2011-09-26 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/46105
|
||||
* typeck.c (structural_comptypes): Ignore cv-quals on typename scope.
|
||||
|
||||
PR c++/50508
|
||||
* semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
|
||||
rather than ==.
|
||||
|
@ -1300,7 +1300,9 @@ structural_comptypes (tree t1, tree t2, int strict)
|
||||
if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
|
||||
TYPENAME_TYPE_FULLNAME (t2)))
|
||||
return false;
|
||||
if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2)))
|
||||
/* Qualifiers don't matter on scopes. */
|
||||
if (!same_type_ignoring_top_level_qualifiers_p (TYPE_CONTEXT (t1),
|
||||
TYPE_CONTEXT (t2)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
2011-09-26 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/46105
|
||||
* g++.dg/template/partial12.C: New.
|
||||
|
||||
PR c++/50508
|
||||
* g++.dg/cpp0x/constexpr-typedef1.C: New.
|
||||
|
||||
|
27
gcc/testsuite/g++.dg/template/partial12.C
Normal file
27
gcc/testsuite/g++.dg/template/partial12.C
Normal file
@ -0,0 +1,27 @@
|
||||
// PR c++/46105
|
||||
|
||||
template< typename T >
|
||||
struct empty { // support class is like stripped-down enable_if
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template< class T, typename v = void > // v is always void!
|
||||
struct element {
|
||||
typedef typename T::value_type type;
|
||||
};
|
||||
|
||||
template< class T > // T in deduced context, T::element_type is SFINAE:
|
||||
struct element< T, typename empty< typename T::element_type >::type > {
|
||||
typedef typename T::element_type type;
|
||||
};
|
||||
|
||||
template< class T >
|
||||
struct element< T const, typename empty< typename T::element_type >::type > {
|
||||
typedef typename T::element_type const type;
|
||||
};
|
||||
|
||||
struct has_et {
|
||||
typedef int element_type;
|
||||
};
|
||||
|
||||
element<has_et const>::type ip = 0;
|
Loading…
x
Reference in New Issue
Block a user