]> granicus.if.org Git - clang/commitdiff
[Attr] Don't print fake MSInheritance argument
authorJoel E. Denny <jdenny.ornl@gmail.com>
Wed, 16 May 2018 14:51:18 +0000 (14:51 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Wed, 16 May 2018 14:51:18 +0000 (14:51 +0000)
This was discovered at:

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180514/228390.html

Reviewed by: aaron.ballman

https://reviews.llvm.org/D46905

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

include/clang/Basic/Attr.td
test/SemaCXX/attr-print.cpp

index afd1e019754833efca5652088083aeb8a7a47507..d72544f6556ecd629e28d06d97df2b1218b64dfc 100644 (file)
@@ -184,7 +184,8 @@ class VersionArgument<string name, bit opt = 0> : Argument<name, opt>;
 class AlignedArgument<string name, bit opt = 0> : Argument<name, opt>;
 
 // A bool argument with a default value
-class DefaultBoolArgument<string name, bit default> : BoolArgument<name, 1> {
+class DefaultBoolArgument<string name, bit default, bit fake = 0>
+    : BoolArgument<name, 1, fake> {
   bit Default = default;
 }
 
@@ -2624,7 +2625,7 @@ def UPtr : TypeAttr {
 
 def MSInheritance : InheritableAttr {
   let LangOpts = [MicrosoftExt];
-  let Args = [DefaultBoolArgument<"BestCase", 1>];
+  let Args = [DefaultBoolArgument<"BestCase", /*default*/1, /*fake*/1>];
   let Spellings = [Keyword<"__single_inheritance">,
                    Keyword<"__multiple_inheritance">,
                    Keyword<"__virtual_inheritance">,
index f40d803e94cbe6b50cfe587cc26a350df23a822d..960050bc7106afcf213caa55b25aec20a5f50bfc 100644 (file)
@@ -34,3 +34,12 @@ class __attribute__((consumable(unknown))) AttrTester1 {
   // CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed")));
   void callableWhen()  __attribute__((callable_when("unconsumed", "consumed")));
 };
+
+// CHECK: class __single_inheritance SingleInheritance;
+class __single_inheritance SingleInheritance;
+
+// CHECK: class __multiple_inheritance MultipleInheritance;
+class __multiple_inheritance MultipleInheritance;
+
+// CHECK: class __virtual_inheritance VirtualInheritance;
+class __virtual_inheritance VirtualInheritance;