New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expr.throw#2] incorrectly dropping cv-qualifiers CWG2699 #3959
Comments
This will be resolved by #3921 |
According to #3921, "any top-level cv-qualifiers from the type of the (possibly-converted) operand" will be removed. But if they are prvalues, object pointers and function pointers can't have top-level cv-qualifiers. |
Yes, no cv-qualifiers would be removed in such cases as there are none to remove. Is that problematic? |
Well, that part of the sentence is ambiguously written because it assumes that a reader knows that such prvalues can't have a top-level const. |
The end result would still be the same? |
Okay. |
This part of the C++ Standard says: Evaluating a throw-expression with an operand throws an exception; the type of the exception object is determined by removing any top-level cv-qualifiers from the static type of the operand and adjusting the type from “array of T” or function type T to “pointer to T” .
One might think that this passage implies that if we are dealing with the operand of type const char[3] , the const qualifier will be removed from it and then char[3] will be adjusted to type char* .
The text was updated successfully, but these errors were encountered: