Index: cp/class.c
===================================================================
--- cp/class.c	(revision 192762)
+++ cp/class.c	(working copy)
@@ -6261,7 +6261,7 @@ finish_struct_1 (tree t)
       tree field = first_field (t);
       if (field == NULL_TREE || error_operand_p (field))
 	{
-	  error ("type transparent class %qT does not have any fields", t);
+	  error ("type transparent %q#T does not have any fields", t);
 	  TYPE_TRANSPARENT_AGGR (t) = 0;
 	}
       else if (DECL_ARTIFICIAL (field))
@@ -6275,6 +6275,12 @@ finish_struct_1 (tree t)
 	    }
 	  TYPE_TRANSPARENT_AGGR (t) = 0;
 	}
+      else if (TYPE_MODE (t) != DECL_MODE (field))
+	{
+	  error ("type transparent %q#T cannot be made transparent because "
+		 "a field has neither pointer nor integer type", t);
+	  TYPE_TRANSPARENT_AGGR (t) = 0;
+	}
     }
 }
 
Index: testsuite/g++.dg/ext/transparent-union.C
===================================================================
--- testsuite/g++.dg/ext/transparent-union.C	(revision 0)
+++ testsuite/g++.dg/ext/transparent-union.C	(working copy)
@@ -0,0 +1,5 @@
+// PR c++/53761
+
+typedef union {    // { dg-error "type transparent" }
+   double x;
+} __attribute__(( __transparent_union__ )) example_t;
