Explicitly document that the "counted_by" attribute is only supported in C.
The "counted_by" attribute currently is only supported in C, mention this explicitly in documentation and also issue warnings when see "counted_by" attribute in C++ with -Wattributes. gcc/c-family/ChangeLog: * c-attribs.cc (handle_counted_by_attribute): Is ignored and issues warning with -Wattributes in C++ for now. gcc/ChangeLog: * doc/extend.texi: Explicitly mentions counted_by is available only in C for now. gcc/testsuite/ChangeLog: * g++.dg/ext/flex-array-counted-by.C: New test. * g++.dg/ext/flex-array-counted-by-2.C: New test.
Showing
- gcc/c-family/c-attribs.cc 9 additions, 1 deletiongcc/c-family/c-attribs.cc
- gcc/doc/extend.texi 4 additions, 0 deletionsgcc/doc/extend.texi
- gcc/testsuite/g++.dg/ext/flex-array-counted-by-2.C 13 additions, 0 deletionsgcc/testsuite/g++.dg/ext/flex-array-counted-by-2.C
- gcc/testsuite/g++.dg/ext/flex-array-counted-by.C 11 additions, 0 deletionsgcc/testsuite/g++.dg/ext/flex-array-counted-by.C
Loading
Please register or sign in to comment