+2012-09-19  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR c++/54581
+       * semantics.c (finish_decltype_type): Make vectors not opaque.
+
 2012-09-17  Jason Merrill  <jason@redhat.com>
 
        PR c++/54575
 
          cp_lvalue_kind clk = lvalue_kind (expr);
          type = unlowered_expr_type (expr);
          gcc_assert (TREE_CODE (type) != REFERENCE_TYPE);
+
+         /* For vector types, pick a non-opaque variant.  */
+         if (TREE_CODE (type) == VECTOR_TYPE)
+           type = strip_typedefs (type);
+
          if (clk != clk_none && !(clk & clk_class))
            type = cp_build_reference_type (type, (clk & clk_rvalueref));
        }
 
+2012-09-19  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR c++/54581
+       * g++.dg/cpp0x/decltype-54581.C: New testcase.
+
 2012-09-19  Steve Ellcey  <sellcey@mips.com>
 
        * gcc.target/mips/pr37362.c: Add mips*-mti-elf exception.
 
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-std=gnu++11 -Wall" } */
+
+typedef float v4f __attribute__((vector_size(4*sizeof(float))));
+
+template <class T> void eat (T&&) {}
+
+void test1 ()
+{
+  v4f x = {0,1,2,3};
+  typedef decltype (x < x) v4i;
+  v4i y = {4,5,6,7}; // v4i is not opaque
+  eat (y);
+}
+
+template<class V>
+void test2 ()
+{
+  V x = {0,1,2,3};
+  typedef decltype (x < x) v4i;
+  v4i y = {4,5,6,7}; // v4i is not opaque
+  eat (y);
+}
+
+int main(){
+  test1();
+  test2<v4f>();
+}