aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/c99-variable-length-array.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-02-07 00:15:00 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-02-07 00:15:00 +0000
commit0a29422eb722c0ffbb98b98d8636042b19069f1a (patch)
treea05c8d41e8c6cdab329772107b7e7c23da654e10 /test/SemaCXX/c99-variable-length-array.cpp
parentf9ea953f22d8e50cae7fd541406d6f563ef86cda (diff)
Misc improvements to the diagnostic when a variable is odr-used in a context that is not allowed to capture variables.
Fixes PR11883. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/c99-variable-length-array.cpp')
-rw-r--r--test/SemaCXX/c99-variable-length-array.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/SemaCXX/c99-variable-length-array.cpp b/test/SemaCXX/c99-variable-length-array.cpp
index 2f9bb957ec..7773c0849b 100644
--- a/test/SemaCXX/c99-variable-length-array.cpp
+++ b/test/SemaCXX/c99-variable-length-array.cpp
@@ -73,10 +73,11 @@ void test_accept_array(int N) {
}
// Variably-modified types cannot be used in local classes.
-void local_classes(int N) {
+void local_classes(int N) { // expected-note {{declared here}}
struct X {
int size;
int array[N]; // expected-error{{fields must have a constant size: 'variable length array in structure' extension will never be supported}} \
+ // expected-error{{reference to local variable 'N' declared in enclosing function 'local_classes'}} \
// expected-warning{{variable length arrays are a C99 feature}}
};
}