From dcbf2e8e65b9d3e7ad9353c7456ae8a878dd70ad Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Wed, 16 May 2018 14:51:18 +0000 Subject: [PATCH] [Attr] Don't print fake MSInheritance argument 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 llvm-svn: 332474 --- clang/include/clang/Basic/Attr.td | 5 +++-- clang/test/SemaCXX/attr-print.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index afd1e01..d72544f 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -184,7 +184,8 @@ class VersionArgument : Argument; class AlignedArgument : Argument; // A bool argument with a default value -class DefaultBoolArgument : BoolArgument { +class DefaultBoolArgument + : BoolArgument { 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">, diff --git a/clang/test/SemaCXX/attr-print.cpp b/clang/test/SemaCXX/attr-print.cpp index f40d803..960050b 100644 --- a/clang/test/SemaCXX/attr-print.cpp +++ b/clang/test/SemaCXX/attr-print.cpp @@ -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; -- 2.7.4