blob: e57376f9b467cd70c7b4731719137906e90f5ee6 [file] [log] [blame]
// PR c++/47851
// { dg-do compile { target c++11 } }
struct Type {
void display_type();
void display_type() const { }
};
typedef Type const ConstType;
struct ConvertibleToType {
operator Type&() { return *reinterpret_cast<Type*>(this); }
};
int main ()
{
// Both lines should call the const variant.
(true ? ConvertibleToType() : ConstType()).display_type();
decltype((true ? ConvertibleToType() : ConstType()))().display_type();
}