From: Joel E. Denny Date: Wed, 16 May 2018 14:51:18 +0000 (+0000) Subject: [Attr] Don't print fake MSInheritance argument X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bde186a041eadca1b0f2cc7ad05b9f07d846730;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332474 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index afd1e01975..d72544f655 100644 --- a/include/clang/Basic/Attr.td +++ b/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/test/SemaCXX/attr-print.cpp b/test/SemaCXX/attr-print.cpp index f40d803e94..960050bc71 100644 --- a/test/SemaCXX/attr-print.cpp +++ b/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;