add some static asserts, use them, fix gcc 4.3 warning in Product.h.
diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h
index 9b15d42..167993e 100644
--- a/Eigen/src/Core/CwiseNullaryOp.h
+++ b/Eigen/src/Core/CwiseNullaryOp.h
@@ -225,6 +225,7 @@
 const typename MatrixBase<Derived>::ConstantReturnType
 MatrixBase<Derived>::constant(const Scalar& value)
 {
+  EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
   return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_constant_op<Scalar>(value));
 }
 
@@ -472,6 +473,7 @@
 inline const CwiseNullaryOp<ei_scalar_identity_op<typename ei_traits<Derived>::Scalar>, Derived>
 MatrixBase<Derived>::identity()
 {
+  EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
   return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_identity_op<Scalar>());
 }
 
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h
index 569d720..92988b7 100644
--- a/Eigen/src/Core/Matrix.h
+++ b/Eigen/src/Core/Matrix.h
@@ -235,7 +235,10 @@
     EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, *=)
     EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, /=)
 
-    /** Default constructor, for fixed-size matrices, does nothing.
+    /** Default constructor.
+      *
+      * For fixed-size matrices, does nothing.
+      *
       * For dynamic-size matrices, initializes with initial size 1x1, which is inefficient, hence
       * when performance matters one should avoid using this constructor on dynamic-size matrices.
       */
@@ -253,11 +256,9 @@
     inline explicit Matrix(int dim)
       : m_storage(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim)
     {
+      EIGEN_STATIC_ASSERT_VECTOR_ONLY(Matrix)
       ei_assert(dim > 0);
-      ei_assert((RowsAtCompileTime == 1
-              && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == dim))
-          || (ColsAtCompileTime == 1
-              && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == dim)));
+      ei_assert(SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim);
     }
 
     /** This constructor has two very different behaviors, depending on the type of *this.
@@ -287,24 +288,21 @@
     /** constructs an initialized 2D vector with given coefficients */
     inline Matrix(const float& x, const float& y)
     {
-      ei_assert((RowsAtCompileTime == 1 && ColsAtCompileTime == 2)
-          || (RowsAtCompileTime == 2 && ColsAtCompileTime == 1));
+      EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 2);
       m_storage.data()[0] = x;
       m_storage.data()[1] = y;
     }
     /** constructs an initialized 2D vector with given coefficients */
     inline Matrix(const double& x, const double& y)
     {
-      ei_assert((RowsAtCompileTime == 1 && ColsAtCompileTime == 2)
-          || (RowsAtCompileTime == 2 && ColsAtCompileTime == 1));
+      EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 2);
       m_storage.data()[0] = x;
       m_storage.data()[1] = y;
     }
     /** constructs an initialized 3D vector with given coefficients */
     inline Matrix(const Scalar& x, const Scalar& y, const Scalar& z)
     {
-      ei_assert((RowsAtCompileTime == 1 && ColsAtCompileTime == 3)
-          || (RowsAtCompileTime == 3 && ColsAtCompileTime == 1));
+      EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3);
       m_storage.data()[0] = x;
       m_storage.data()[1] = y;
       m_storage.data()[2] = z;
@@ -312,8 +310,7 @@
     /** constructs an initialized 4D vector with given coefficients */
     inline Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w)
     {
-      ei_assert((RowsAtCompileTime == 1 && ColsAtCompileTime == 4)
-          || (RowsAtCompileTime == 4 && ColsAtCompileTime == 1));
+      EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4);
       m_storage.data()[0] = x;
       m_storage.data()[1] = y;
       m_storage.data()[2] = z;
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 831611a..bf491b7 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -529,7 +529,7 @@
   {
     enum {
       EvalToRes = (ei_packet_traits<Scalar>::size==1)
-                ||(DestDerived::Flags&ActualPacketAccessBit) && (!(DestDerived::Flags & RowMajorBit)) };
+                ||((DestDerived::Flags&ActualPacketAccessBit) && (!(DestDerived::Flags & RowMajorBit))) };
     Scalar* __restrict__ _res;
     if (EvalToRes)
        _res = &res.coeffRef(0);
@@ -572,7 +572,7 @@
   {
     enum {
       EvalToRes = (ei_packet_traits<Scalar>::size==1)
-                ||(DestDerived::Flags & ActualPacketAccessBit) && (DestDerived::Flags & RowMajorBit) };
+                ||((DestDerived::Flags & ActualPacketAccessBit) && (DestDerived::Flags & RowMajorBit)) };
     Scalar* __restrict__ _res;
     if (EvalToRes)
        _res = &res.coeffRef(0);
diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h
index 9fcf55d..6979e4a 100644
--- a/Eigen/src/Core/util/StaticAssert.h
+++ b/Eigen/src/Core/util/StaticAssert.h
@@ -58,7 +58,9 @@
         you_tried_calling_a_vector_method_on_a_matrix,
         you_mixed_vectors_of_different_sizes,
         you_mixed_matrices_of_different_sizes,
+        this_method_is_only_for_vectors_of_a_specific_size,
         you_did_a_programming_error,
+        you_called_a_fixed_size_method_on_a_dynamic_size_matrix_or_vector,
         unaligned_load_and_store_operations_unimplemented_on_AltiVec
       };
     };
@@ -75,12 +77,22 @@
 #endif // EIGEN_NO_STATIC_ASSERT
 
 
-// static assertion failling if the type \a TYPE is not a vector type
+// static assertion failing if the type \a TYPE is not a vector type
 #define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE) \
   EIGEN_STATIC_ASSERT(TYPE::IsVectorAtCompileTime, \
                       you_tried_calling_a_vector_method_on_a_matrix)
 
-// static assertion failling if the two vector expression types are not compatible (same fixed-size or dynamic size)
+// static assertion failing if the type \a TYPE is not fixed-size
+#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE) \
+  EIGEN_STATIC_ASSERT(TYPE::SizeAtCompileTime!=Eigen::Dynamic, \
+                      you_called_a_fixed_size_method_on_a_dynamic_size_matrix_or_vector)
+
+// static assertion failing if the type \a TYPE is not a vector type of the given size
+#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE) \
+  EIGEN_STATIC_ASSERT(TYPE::IsVectorAtCompileTime && TYPE::SizeAtCompileTime==SIZE, \
+                      this_method_is_only_for_vectors_of_a_specific_size)
+
+// static assertion failing if the two vector expression types are not compatible (same fixed-size or dynamic size)
 #define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0,TYPE1) \
   EIGEN_STATIC_ASSERT( \
       (int(TYPE0::SizeAtCompileTime)==Eigen::Dynamic \
@@ -88,7 +100,7 @@
     || int(TYPE0::SizeAtCompileTime)==int(TYPE1::SizeAtCompileTime)),\
     you_mixed_vectors_of_different_sizes)
 
-// static assertion failling if the two matrix expression types are not compatible (same fixed-size or dynamic size)
+// static assertion failing if the two matrix expression types are not compatible (same fixed-size or dynamic size)
 #define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0,TYPE1) \
   EIGEN_STATIC_ASSERT( \
      ((int(TYPE0::RowsAtCompileTime)==Eigen::Dynamic \