diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp
index 80e9842a9bc898e2d7de9bfeb83cbc477131cd35..4bd1561425628ed9af58d34b0810b6110dce4752 100644
--- a/indra/llui/llrngwriter.cpp
+++ b/indra/llui/llrngwriter.cpp
@@ -29,14 +29,7 @@
 #include "llrngwriter.h"
 #include "lluicolor.h"
 
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdelete-incomplete"
 #include "lluictrlfactory.h"
-#pragma clang diagnostic pop
-#else
-#include "lluictrlfactory.h"
-#endif
 
 #include "boost/bind.hpp"
 
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 0ed7fb09b31d41d2623b9696c6d50d9288d26e7d..135ed57a4fba36249863421e70f464bdd38789b3 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -37,6 +37,7 @@
 #include "llheteromap.h"
 
 class LLView;
+void deleteView(LLView*); // Inside LLView.cpp, avoid having to potentially delete an incomplete type here.
 
 // lookup widget constructor funcs by widget name
 template <typename DERIVED_TYPE>
@@ -174,14 +175,7 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 				{
 					LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL;
 
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdelete-incomplete"
-					delete view;
-#pragma clang diagnostic pop
-#else
-					delete view;
-#endif
+					deleteView(view);
 					view = NULL;
 				}
 			}
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 593c8b12fc8a7c328de2e52eabba3a4ed8340c6b..bd213d594a90e250ed20eaca001c081cdc178be6 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -86,6 +86,11 @@ template class LLView* LLView::getChild<class LLView>(
 
 static LLDefaultChildRegistry::Register<LLView> r("view");
 
+void deleteView(LLView *aView)
+{
+	delete aView;
+}
+
 namespace LLInitParam
 {
 	void TypeValues<LLView::EOrientation>::declareValues()