]> granicus.if.org Git - clang/commitdiff
Implement a warning flag for the warning about default arguments making
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Fri, 3 Jun 2011 17:55:52 +0000 (17:55 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Fri, 3 Jun 2011 17:55:52 +0000 (17:55 +0000)
special member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132564 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
test/SemaCXX/default-arg-special-member.cpp

index cad4b5ef6ac1bf65fbf915e4a5cdd8e9a6190523..9abd6d3c5769904a789189db0197175175e1dedd 100644 (file)
@@ -33,6 +33,7 @@ def : DiagGroup<"char-align">;
 def Comment : DiagGroup<"comment">;
 def : DiagGroup<"ctor-dtor-privacy">;
 def : DiagGroup<"declaration-after-statement">;
+def DefaultArgSpecialMember : DiagGroup<"default-arg-special-member">;
 def GNUDesignator : DiagGroup<"gnu-designator">;
 
 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
index 33c3445d51dcb82380c3d4a1556b481801ecd74d..95f455f6e4d8ec4b8af69de7f9142e0a1a80c960 100644 (file)
@@ -1416,11 +1416,12 @@ def err_uninitialized_member_in_ctor : Error<
   "the %select{reference|const}2 member %3">;
 def warn_default_arg_makes_ctor_special : Warning<
   "addition of default argument on redeclaration makes this constructor a "
-  "%select{default|copy|move}0 constructor">;
+  "%select{default|copy|move}0 constructor">, InGroup<DefaultArgSpecialMember>;
 def note_previous_declaration_special : Note<
   // The ERRORs are in hopes that if they occur, they'll get reported.
   "previous declaration was %select{*ERROR*|a copy constructor|a move "
-  "constructor|*ERROR*|*ERROR*|*ERROR*|not a special member function}0">;
+  "constructor|*ERROR*|*ERROR*|*ERROR*|not a special member function}0">,
+  InGroup<DefaultArgSpecialMember>;
 
 def err_use_of_default_argument_to_function_declared_later : Error<
   "use of default argument to function %0 that is declared later in class %1">;
index aadbbeb2fcd70a178ef4065427f39f119c4159fd..015ea3d7f70d5033ae5f6545a874173f263f046f 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUM: %clang_cc1 -Wno-default-arg-special-member -Werror -fsyntax-only %s
 
 class foo {
   foo(foo&, int); // expected-note {{was not a special member function}}