mode. This allows us to detect invalid VLAs in Objective-C++
mode. This should be the last of <rdar://problem/
7660386>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96679
91177308-0d34-0410-b5e6-
96231b3b80d8
"Haven't past the location of the identifier yet?");
// Don't parse attributes unless we have an identifier.
- if (D.getIdentifier() && getLang().CPlusPlus
+ if (D.getIdentifier() && getLang().CPlusPlus0x
&& isCXX0XAttributeSpecifier(true)) {
SourceLocation AttrEndLoc;
CXX0XAttributeList Attr = ParseCXX0XAttributes();
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+@interface Data
+- (unsigned)length;
+- (void)getData:(void*)buffer;
+@end
+
+void test(Data *d) {
+ char buffer[[d length]]; // expected-error{{variable length arrays are not permitted in C++}}
+ [d getData:buffer];
+}
+