summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/c99-variable-length-array.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implementation of VlA of GNU C++ extension, by Vladimir Yakovlev.Alexey Bataev2016-04-291-2/+2
| | | | | | | This enables GNU C++ extension "Variable length array" by default. Differential Revision: http://reviews.llvm.org/D18823 llvm-svn: 268018
* Allow transformation of VariableArray to ConstantArray.Serge Pavlov2014-02-061-0/+21
| | | | | | | | | | | | | | | | | In the following code: struct A { static const int sz; }; template<class T> void f() { T arr[A::sz]; } the array 'arr' is represented as a variable size array in the template. If 'A::sz' gets value below in the translation unit, the array in instantiation can turn into constant size array. This change fixes PR18633. Differential Revision: http://llvm-reviews.chandlerc.com/D2688 llvm-svn: 200899
* Improve 'failed template argument deduction' diagnostic for the case where weRichard Smith2013-01-311-1/+2
| | | | | | | | have a direct mismatch between some component of the template and some component of the argument. The diagnostic now says what the mismatch was, but doesn't yet say which part of the template doesn't match. llvm-svn: 174039
* Implement -Wvla correctlyDmitri Gribenko2013-01-231-1/+1
| | | | | | | | | | | | | GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA, for example, if they are forbidden by coding guidelines). Currently Clang implements -Wvla as "warn on VLA when it is an extension". The attached patch makes our behavior match GCC. The existing vla extwarn is moved under -Wvla-extension and is still included into -Wgnu. This fixes PR5953. llvm-svn: 173286
* Misc improvements to the diagnostic when a variable is odr-used in a context ↵Eli Friedman2012-02-071-1/+2
| | | | | | | | that is not allowed to capture variables. Fixes PR11883. llvm-svn: 149937
* Fix a crash involving a multi-dimensional dependent VLA. PR11744.Eli Friedman2012-01-251-0/+8
| | | | llvm-svn: 148989
* Change the diagnostics which said 'accepted as an extension' to instead sayRichard Smith2011-12-291-12/+12
| | | | | | | 'is an extension'. The former is inappropriate and confusing when building with -Werror/-pedantic-errors. llvm-svn: 147357
* when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be ↵Chris Lattner2011-06-141-0/+9
| | | | | | | | | | folded to a constant as constant size arrays. This has slightly different semantics in some insane cases, but allows us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code llvm-svn: 132983
* Reject the allocation of variably-modified types in C++ 'new'Douglas Gregor2010-10-061-0/+7
| | | | | | | | expressions. Fixes PR8209 in the narrowest way possible. I'm still considering whether I want to implement the extension that permits the use of VLA types in a 'new' expression. llvm-svn: 115790
* Don't complain about VLAs of non-POD types when the array type isDouglas Gregor2010-05-241-0/+14
| | | | | | dependent. Fixes <rdar://problem/8021385>. llvm-svn: 104550
* Make sure that we instantiate variably modified types, even if theyDouglas Gregor2010-05-241-0/+10
| | | | | | aren't dependent. Fixes <rdar://problem/8020206>. llvm-svn: 104511
* It turns out that people love using VLAs in templates, too. Weaken ourDouglas Gregor2010-05-231-4/+5
| | | | | | | | VLA restrictions so that one can use VLAs in templates (even accidentally), but not as part of a non-type template parameter (which would be very bad). llvm-svn: 104471
* Put the VLA-is-an-extension warning into its own warning group (-Wvla)Douglas Gregor2010-05-231-7/+8
| | | | | | so that it can be selectively enabled/disabled. llvm-svn: 104462
* Even though we don't unique VLA types, we still need to build aDouglas Gregor2010-05-231-0/+10
| | | | | | canonical type where the element type is canonical. Fixes PR7206. llvm-svn: 104461
* Implement support for variable length arrays in C++. VLAs are limitedDouglas Gregor2010-05-221-0/+80
in several important ways: - VLAs of non-POD types are not permitted. - VLAs cannot be used in conjunction with C++ templates. These restrictions are intended to keep VLAs out of the parts of the C++ type system where they cause the most trouble. Fixes PR5678 and <rdar://problem/8013618>. llvm-svn: 104443
OpenPOWER on IntegriCloud