We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e3f0c0d + d737ad9 commit 4b6b568Copy full SHA for 4b6b568
clang/include/clang/Basic/Attr.td
@@ -1837,7 +1837,6 @@ def LifetimeBound : DeclOrTypeAttr {
1837
let Spellings = [Clang<"lifetimebound", 0>];
1838
let Subjects = SubjectList<[ParmVar, ImplicitObjectParameter], ErrorDiag>;
1839
let Documentation = [LifetimeBoundDocs];
1840
- let LangOpts = [CPlusPlus];
1841
let SimpleHandler = 1;
1842
}
1843
clang/test/Sema/attr-lifetimebound.c
@@ -0,0 +1,8 @@
1
+// RUN: %clang_cc1 -std=c99 -verify %s
2
+
3
+int *f(int* p __attribute__((lifetimebound)));
4
5
+int *g() {
6
+ int i;
7
+ return f(&i); // expected-warning {{address of stack memory associated with local variable 'i' returned}}
8
+}
0 commit comments