Give the "cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime" warning a -W flag (non-pod-varargs) and default it being an error by default.  There is no good reason to allow users to get bitten by this sort of thing by default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91094 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/overload-call-copycon.cpp b/test/SemaCXX/overload-call-copycon.cpp
index 755e27a..6436236 100644
--- a/test/SemaCXX/overload-call-copycon.cpp
+++ b/test/SemaCXX/overload-call-copycon.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only %s 
+// RUN: clang-cc -fsyntax-only %s -Wnon-pod-varargs
 class X { };
 
 int& copycon(X x);
@@ -23,10 +23,10 @@
 
 void test_copycon2(A a, const A ac, B b, B const bc, B volatile bv) {
   int& i1 = copycon2(b);
-  float& f1 = copycon2(bc);
-  float& f2 = copycon2(bv);
+  float& f1 = copycon2(bc); // expected-warning {{cannot pass object of non-POD type}}
+  float& f2 = copycon2(bv); // expected-warning {{cannot pass object of non-POD type}}
   short& s1 = copycon2(a);
-  float& f3 = copycon2(ac);
+  float& f3 = copycon2(ac); // expected-warning {{cannot pass object of non-POD type}}
 }
 
 int& copycon3(A a);
@@ -34,7 +34,7 @@
 
 void test_copycon3(B b, const B bc) {
   int& i1 = copycon3(b);
-  float& f1 = copycon3(bc);
+  float& f1 = copycon3(bc); // expected-warning {{cannot pass object of non-POD type}}
 }