From a94e7b6acf15afbac93181f49cf23b9a3cea3df5 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Tue, 25 Aug 2015 16:44:38 +0000 Subject: [Sema] Handle leading and trailing __ for GNU attributes GNU attributes can have a leading and trailing __ appended/prepended to the attribute name. While the parser and AttributeList::getKind did the right thing, AttributeList::getAttributeSpellingListIndex did not. This fixes PR24565. llvm-svn: 245953 --- clang/test/SemaCXX/attr-print.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/test/SemaCXX/attr-print.cpp') diff --git a/clang/test/SemaCXX/attr-print.cpp b/clang/test/SemaCXX/attr-print.cpp index 337a6fb69ba..f40d803e94c 100644 --- a/clang/test/SemaCXX/attr-print.cpp +++ b/clang/test/SemaCXX/attr-print.cpp @@ -26,6 +26,9 @@ int small __attribute__((mode(byte))); // CHECK: int v __attribute__((visibility("hidden"))); int v __attribute__((visibility("hidden"))); +// CHECK: char *PR24565() __attribute__((malloc)) +char *PR24565() __attribute__((__malloc__)); + // CHECK: class __attribute__((consumable("unknown"))) AttrTester1 class __attribute__((consumable(unknown))) AttrTester1 { // CHECK: void callableWhen() __attribute__((callable_when("unconsumed", "consumed"))); -- cgit v1.2.3