Commit d6850483 by Jason Merrill Committed by Jason Merrill

* call.c (type_decays_to): Call cv_unqualified for non-class type.

From-SVN: r158240
parent 9d809e8f
2010-04-12 Jason Merrill <jason@redhat.com>
* call.c (type_decays_to): Call cv_unqualified for non-class type.
2010-04-12 Fabien Chene <fabien.chene@gmail.com> 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
PR c++/25811 PR c++/25811
......
...@@ -2263,6 +2263,8 @@ type_decays_to (tree type) ...@@ -2263,6 +2263,8 @@ type_decays_to (tree type)
return build_pointer_type (TREE_TYPE (type)); return build_pointer_type (TREE_TYPE (type));
if (TREE_CODE (type) == FUNCTION_TYPE) if (TREE_CODE (type) == FUNCTION_TYPE)
return build_pointer_type (type); return build_pointer_type (type);
if (!CLASS_TYPE_P (type))
type = cv_unqualified (type);
return type; return type;
} }
......
2010-04-12 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/lambda/lambda-deduce2.C: New.
2010-04-12 Fabien Chene <fabien.chene@gmail.com> 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
PR c++/25811 PR c++/25811
......
// Test that cv-quals are dropped from non-class return type
// { dg-options "-std=c++0x" }
template <class T, class U>
struct assert_same_type;
template <class T>
struct assert_same_type<T,T> { };
struct A
{
int i;
};
extern const int i;
assert_same_type <decltype ([]{ return i; }()), int> x;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment