Index: include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- include/clang/Basic/DiagnosticParseKinds.td	(revision 214739)
+++ include/clang/Basic/DiagnosticParseKinds.td	(working copy)
@@ -600,6 +600,8 @@
 def warn_cxx98_compat_two_right_angle_brackets : Warning<
   "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
   InGroup<CXX98Compat>, DefaultIgnore;
+def err_templated_invalid_declaration : Error<
+  "a template declaration cannot be followed by a static_assert declaration">;
 def err_multiple_template_declarators : Error<
   "%select{|a template declaration|an explicit template specialization|"
   "an explicit template instantiation}0 can "
Index: lib/Parse/ParseDeclCXX.cpp
===================================================================
--- lib/Parse/ParseDeclCXX.cpp	(revision 214730)
+++ lib/Parse/ParseDeclCXX.cpp	(working copy)
@@ -2077,7 +2077,9 @@
 
   // static_assert-declaration
   if (Tok.is(tok::kw_static_assert) || Tok.is(tok::kw__Static_assert)) {
-    // FIXME: Check for templates
+    if (TemplateInfo.Kind)
+      Diag(TemplateInfo.getSourceRange().getBegin(),
+           diag::err_templated_invalid_declaration) << Tok.getLocation();
     SourceLocation DeclEnd;
     ParseStaticAssertDeclaration(DeclEnd);
     return;
Index: test/Parser/cxx11-templates.cpp
===================================================================
--- test/Parser/cxx11-templates.cpp	(revision 0)
+++ test/Parser/cxx11-templates.cpp	(working copy)
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+
+struct S {
+  template <typename Ty = char> // expected-error {{a template declaration cannot be followed by a static_assert declaration}}
+  static_assert(sizeof(Ty) != 1, "Not a char");
+};
