1Pull in r200899 from upstream clang trunk (by Serge Pavlov): 2 3 Allow transformation of VariableArray to ConstantArray. 4 5 In the following code: 6 7 struct A { static const int sz; }; 8 template<class T> void f() { T arr[A::sz]; } 9 10 the array 'arr' is represented as a variable size array in the template. 11 If 'A::sz' gets value below in the translation unit, the array in 12 instantiation can turn into constant size array. 13 14 This change fixes PR18633. 15 16 Differential Revision: http://llvm-reviews.chandlerc.com/D2688 17
| 1Pull in r200899 from upstream clang trunk (by Serge Pavlov): 2 3 Allow transformation of VariableArray to ConstantArray. 4 5 In the following code: 6 7 struct A { static const int sz; }; 8 template<class T> void f() { T arr[A::sz]; } 9 10 the array 'arr' is represented as a variable size array in the template. 11 If 'A::sz' gets value below in the translation unit, the array in 12 instantiation can turn into constant size array. 13 14 This change fixes PR18633. 15 16 Differential Revision: http://llvm-reviews.chandlerc.com/D2688 17
|
18Introduced here: http://svn.freebsd.org/changeset/base/261680
| 18Introduced here: http://svnweb.freebsd.org/changeset/base/261680
|
19 20Index: tools/clang/test/SemaCXX/c99-variable-length-array.cpp 21=================================================================== 22--- tools/clang/test/SemaCXX/c99-variable-length-array.cpp 23+++ tools/clang/test/SemaCXX/c99-variable-length-array.cpp 24@@ -140,3 +140,24 @@ namespace PR11744 { 25 } 26 int test = f<int>(0); // expected-note {{instantiation of}}
--- 37 unchanged lines hidden --- | 19 20Index: tools/clang/test/SemaCXX/c99-variable-length-array.cpp 21=================================================================== 22--- tools/clang/test/SemaCXX/c99-variable-length-array.cpp 23+++ tools/clang/test/SemaCXX/c99-variable-length-array.cpp 24@@ -140,3 +140,24 @@ namespace PR11744 { 25 } 26 int test = f<int>(0); // expected-note {{instantiation of}}
--- 37 unchanged lines hidden --- |