Doc. no. | N3838 |
Date: | 2014-01-16 |
Project: | Programming Language C++ |
Reply to: | Ville Voutilainen <[email protected]> |
Revised 2014-01-16 at 19:01:45 UTC
Reference ISO/IEC IS 14882:2003(E)
Also see:
This document contains only evolution issues which have been closed by the Evolution Working Group as duplicates or not defects. That is, issues which have a status of Dup or NAD. See the Evolution Active Issues List active issues and more information. See the Evolution Complete Issues List for issues considered accepted extensions. The introductory material in that document also applies to this document.
Section: 20.9 [meta] Status: NAD Submitter: Dean Michael Berris Opened: 2012-09-18 Last modified: 2013-10-14
View other active issues in [meta].
View all other issues in [meta].
View all issues with NAD status.
Discussion:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3410.pdfTo be handled by the Reflection Study Group (SG7).
Discussed by SG7 in Chicago, SG7 doesn't think the paper is going into the right direction and the paper author has acknowledged so.
Section: 5.19 [expr.const] Status: NAD Submitter: Dave Abrahams Opened: 2012-10-16 Last modified: 2013-10-14
View all other issues in [expr.const].
View all issues with NAD status.
Discussion:
constexpr functions are crippled by the fact that they have to be valid at runtime. Things that are tantalizingly close but you can't quite do include returning a type that depends on the /value/ of a function parameter:
constexpr auto ptr_array(int N) -> int(*)[N] { ... }If we would allow for constexpr functions that can only be evaluated at compile time, we'd be able to do compile-time computation in a much less template-heavy way.
Bristol 2013: Gregor thought that wrt general direction, constexpr is specifically not to have a constexpr-only model, and this issue would go into the opposite direction. NAD.
Section: 13 [over] Status: NAD Submitter: Nevin Liber Opened: 2012-10-19 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
struct Silly { template<class... Ts> Silly(Ts&&...) {} }; int main() { Silly s; Silly t(s); // Silly::Silly(Ts &&...) [Ts = <Silly &>] const Silly u; Silly v(u); // calls Silly::Silly(Silly const&) }The problem is that users expect the copy constructor to be called in both situations. Note: you do not need variadics for this; it made the example smaller. Also, this issue existed in C++03, but rarely happened in practice because templated parameters were usually declared const T&.
Bristol 2013: Sutton and Gregor proposed various work-arounds, like additional overloads and constraints. Stroustrup asked whether having a copying template have different semantics from a copy constructor isn't an error, and Gregor explained that tuples run into that issue and they have different semantics for the template. The submitter is encouraged to write a paper, and practical examples are desirable.
The EWG decided to close this issue as a NAD in Chicago 2013.
Section: 7.2 [dcl.enum] Status: NAD Submitter: Jeffrey Yasskin Opened: 2012-10-20 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
In Beman's filesystem code, I found the following problem, which he didn't see because he's been building with MSVC 10: A scoped enum defined at
is used likeif (opts & copy_options::skip_existing) ++ct;
athttps://github.com/Beman/filesystem-proposal/blob/master/src/operations.cpp#L773.
This causes an error like:../../../libs/filesystem/src/operations.cpp:773:9: error: value of type 'boost::filesystem::copy_options' is not contextually convertible to 'bool'
I believe it makes sense to define a contextual conversion to bool for certain scoped enumerations, but I don't see a way to do it. I do see a way to overload & to return bool, but that seems to prevent using & to remove bits from a value, which shouldn't always be prevented.Bristol 2013: Stroustrup pointed out that the existing behavior is deliberately trying to avoid supporting anything like this, in order to play safe. He further explained that allowing member functions for scoped enums has been attempted but the attempts failed. Gregor pointed out that not all scoped enums have a zero value, so doing it generally is hard. Stroustrup said he would want to have member functions for enums. Yasskin said he's not interested in writing a paper. Other people are invited to do so.
Section: 12.3 [class.conv] Status: NAD Submitter: Jeffrey Yasskin Opened: 2012-10-24 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
If a type has two implicit conversions, and I call a function with overloads for both target types, there's no way to disambiguate short of writing the conversion explicitly or adding another overload. It would be nice to be able to extend the partial order on conversions.
Bristol 2013: The group doesn't see this as something that we should pursue, and thinks it's a design error and users are advised just not to do this. NAD.
Section: 5 [expr] Status: NAD Submitter: Alisdair Meredith Opened: 2012-10-28 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
I have a low-priority issue for adding the (neglected) logical-xor operator, ^^. This has traditionally been dismissed as un-necessary, as it is equivalent to boolean operator!=, and there is no short-circuiting benefit to justify adding it. However, contextual conversions to 'bool' are handled specially for logical operators, and in that context it would be completing a hole in the language. I wish I had a better example, but pulling from the standard library:
function<void()> a; function<void()> b; assert(a != b); // does not compile assert(a ^^ b); // would compile, and assert!
Bristol 2013: EWG doesn't believe reopening this discussion, it's been tried previously and it's unlikely that a new round would lead to anything. NAD.
Section: 5.17 [expr.ass] Status: NAD Submitter: Mike Miller Opened: 2012-11-02 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
In Portland, CWG categorized a number of issues as "extension," which I presume you will automatically look at for potential EWG involvement once the new revision of the issues list is out. I did want to mention one issue for which we will be resolving part and referring the other part to EWG: issue 1542 raises the question of whether the narrowing rules make sense for a compound assignment, e.g.,
char c; c += {1};CWG addressed a similar issue (1078) for an ordinary assignment and decided that, although the narrowing error was annoying in that case, it wasn't worth the effort to change the language because the workaround was simply to add a cast. In this case, however, there's no way to avoid the error (no place to put the cast). I think we'd be happy with a revision of the narrowing rules that addressed both this case and the one in 1078; maybe the answer is just "why would you use the { } form in a case like this anyway?" The Core issue link here.
In Bristol 2013: EWG thinks the answer _is_ just "why would you use the { } form in a case like this anyway?". NAD.
Section: 11.3 [class.friend] Status: NAD Submitter: Gabriel Dos Reis Opened: 2012-11-10 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
When we went from C++98 to C++03 we made nested classes implicitly friend of their enclosing classes. We seem to have missed doing the same for local classes defined at member functions scopes.
Mike Miller explained:Hmm. I think that's already covered by 11p2:
A member of a class can also access all the names to which the class has access. A local class of a member function may access the same names that the member function itself may access.By the definition of "private" in 11p1, a nested class has access to the private members of the containing class; a member function of the nested class therefore also has access to the private members of the containing class; a local class of such a member function has the same access as the member function; and a member function of the local class has the same access as the local class, the same access as the containing member function, and the same access as the nested class.
Section: 17 [library] Status: NAD Submitter: Nevin Liber Opened: 2013-02-05 Last modified: 2013-10-14
View all other issues in [library].
View all issues with NAD status.
Discussion:
In C++11, all the containers, pair, tuple, etc. always have the relation operators defined for them (==, !=, <, >, <=, >=), even if the contained type does not have them; they just fail to compile if one tries to invoke them. It would be better if those operators were SFINAEed out, so that generic code can then detect it and apply alternate strategies.
A use case I've have for this is when holding stateless objects that don't normally have the relation operators defined for them.
Bristol 2013: NAD. The operators have no opportunity for substitution failure.
Section: 8.5.1 [dcl.init.aggr] Status: NAD Submitter: Michael Price Opened: 2013-01-21 Last modified: 2013-10-14
View all other issues in [dcl.init.aggr].
View all issues with NAD status.
Discussion:
http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3526.html
Bristol 2013: Stroustrup thought that the proposal is too aggressive and removes structure, and thought that the existing limitations are deliberate. Stroustrup and Sutton also pointed out that there are existing matrix types that deduce the shape of the matrix from the initializers, and this change would break such existing code. No recommendation to move forward, considered NAD.
Section: 13.5 [over.oper] Status: NAD Submitter: Walter Brown Opened: 2013-03-13 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3746.pdf
http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3553.pdf
Bristol 2013:
Point d in "the basics": left operand is a modifiable lvalue expression and the right operand a modifiable glvalue. Why the asymmetry? JC: it's because the operator returns the lhs.
Bjarne: do we really need a new operator?
Matt: Maybe. swap() has annoying ADL problems.
Daveed: does it really solve them? The operator will still be found by ADL. Matt: maybe, since this would use an intrinsic in place of the general std::swap template.
Bjarne: But swap() isn't going away because of backward compatibility, so now we'll have swap() and operator:=:. "Probably a good idea if we had a time machine". Introducing a new operator, it has to be really central and helpful. If it got us out of our swap problem it might be good enough, but it isn't. Libraries aren't going to stop calling swap and if they did then all the specialized swap functions people have written wouldn't get invoked. Problems are real, but the benefits it would have (i.e. what problem it would actually solve) aren't sufficiently explained. Too likely that swap and :=: would coexist indefinitely and that all the problems of swap would persist.
General agreement that this is a real problem but that it's not clear why this would solve them. We will not proceed with this.
No recommendation to move forward, considered NAD.
Section: 12.8 [class.copy] Status: NAD Submitter: Walter Brown Opened: 2013-03-12 Last modified: 2013-10-14
View all other issues in [class.copy].
View all issues with NAD status.
Discussion:
http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3578.pdf
Bristol 2013: Considered NAD, too early for such a breaking change after C++11, breaks valid programs that use C++11 semantics (defaulted destructor outside class definition, otherwise generated members, used with various smart pointer members).
Section: 5.3.4 [expr.new] Status: NAD Submitter: Thomas Koeppe Opened: 2013-04-22 Last modified: 2014-01-16
View all issues with NAD status.
Discussion:
Basically, I would like to file a Defect Report: The global array placement new, as described in C++11, 5.3.4/10-12, is unusable. The reason for this is that the standard allows the operator to consume an arbitrary amount of memory, which is impossible for the user to learn, and thus impossible to provide. The fix is to remove the ability for placement-new to require more size than required for the array itself to the allocation function.
Current wording, in 5.3.4/12 says:
new(2,f) T[5] results in a call of operator new[](sizeof(T)*5+y,2,f)Here, x and y are non-negative unspecified values representing array allocation overhead; the result of the new-expression will be offset by this amount from the value returned by operator new[].
Unfortunately, the presence of "y" means that it is impossible to pass a usable address to placement-array-new:
void * addr = std::malloc(?); new (addr) T[10];
In the above, it is impossible to know the required argument for malloc, since the placement-new can ask for sizeof(T) * 10 + y bytes for any y.
The fix would be to remove the possiblity of placement-new requiring more memory for arrays, i.e. insert into 5.3.4/10 something like:
A new-expression passes the amount of space requested to the allocation function as the first argument of type std::size_t. That argument shall be no less than the size of the object being created; it may be greater than the size of the object being created only if the object is an array and the new-expression is a default new-expression.
What do you think? I don't think the change could break anything, since nothing could be using placement-array-new at the moment, and it makes sense that a placement version doesn't require extra space, since the caller already knows the array size and has to perform destruction manually anyway.
Mike Miller points out the following:
You're not the first one to notice a problem with this; see
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#476
To summarize, CWG agreed that that's a problem but felt that the resolution was more appropriately handled in EWG, since it requires evaluations of the tradeoffs of various possible options to address it. Your approach, for example, focuses on the placement operator new provided by the library, which simply runs the constructor(s) on a previously-allocated buffer. However, that's not the only use of the placement new syntax, which can pass arbitrary arguments to allocation functions that actually do allocate memory, and it's not clear that none of those will need to add padding similar to the way the standard allocation function does.
In Chicago 2013, EWG deemed this NAD. Remarks from the discussion: "The problem is in trying to use array new to put an array into pre-existing storage. We don't need to use array new for that; just construct them." and "You can find what padding was used after the fact, because new returns a pointer to the start of the first element of the array. But that can happen only after UB. "
Section: 6.6.3 [stmt.return] Status: NAD Submitter: Richard Smith Opened: 2013-07-02 Last modified: 2013-10-14
View all issues with NAD status.
Discussion:
A thread on std-discussion[1] has highlighted that
return E;
where E has type void is valid in a function with a return type of 'void' but not valid in a constructor or destructor. There is implementation variance here, and we have examples of code which very reasonably wants to use "return E;" in a constructor, from within the expansion of a macro, and fails on some compilers due to this rule. The inconsistency between "return;" and "return void();" seems extremely jarring here, and I'd like to propose that we treat this as a defect.
(I'm not suggesting that we treat constructors and destructors as having a return type of 'void', as was suggested on the thread on std-discussion, but I'm not opposed to it.)
[1] https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/ehqGBMsswjk
Discussed in Chicago 2013 (as the NB comment FI 6), no consensus to make a change, NB comment rejected, the issue is NAD. Vandevoorde said this rubs him the wrong way, because this suggests that a constructor returns nothing even though that's not the case.
Section: 7.1.6.4 [dcl.spec.auto] Status: NAD Submitter: Ville Voutilainen Opened: 2013-05-02 Last modified: 2013-10-14
View all other issues in [dcl.spec.auto].
View all issues with NAD status.
Discussion:
http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3681.html
Discussed in Chicago 2013 (as FI 3 NB comment), no consensus to change (concerns about breaking existing code), the NB comment is rejected, the issue is NAD.