C++17 Question | Proposal N3922

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

C++17 Question | Proposal N3922

Louis Dionne via cfe-dev
Hi, 

my name is José Luis, I have a question regarding backwards compatibility of proposal N3922 for C++17:

That change introduces a new incompatibility with C++14 and C++11, as it is stated in the C++17 Standard:
C.4.3 Clause 10: declarations [diff.cpp14.dcl.dcl]

Is it considered a New Feature or a Defect Report?

I am asking this because Clang (and GCC) adopted the new rule not only for C++17 but also for C++14 and C++11. In fact, I found this comment: 
This is a backwards-incompatible change that is applied to all language versions that allow type deduction from auto (per the request of the C++ committee).

Can someone please confirm and explain why the C++ committee requested compiler developers to treat this new rule as a Defect Report and, hence, to fix/change it also in C++11 and C++14?

Or is it just a New Feature and, therefore, C++11 and C++14 should behave in a different way to C++17 as stated in the corresponding published standard versions?

Many Thanks for your Help and Time.
Best Regards, 

José Luis March Cabrelles, PhD
Software Quality Engineer
Solid Sands B.V. 
Mobile: +31 683 97 23 63
Office:  +31 202 44 01 99


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: C++17 Question | Proposal N3922

Louis Dionne via cfe-dev
On Tue, Jan 9, 2018 at 2:52 AM, José Luis March Cabrelles via cfe-dev <[hidden email]> wrote:
Hi, 

my name is José Luis, I have a question regarding backwards compatibility of proposal N3922 for C++17:

There's more information available in the papers referenced by n3922: "For background information see N3681, "Auto and braced-init-lists", by Voutilainen, and N3912, "Auto and braced-init-lists, continued", also by Voutilainen." 


That change introduces a new incompatibility with C++14 and C++11, as it is stated in the C++17 Standard:
C.4.3 Clause 10: declarations [diff.cpp14.dcl.dcl]

Is it considered a New Feature or a Defect Report?

Quoting from n3922: "Direction from EWG is that we consider this a defect in C++14."
 

I am asking this because Clang (and GCC) adopted the new rule not only for C++17 but also for C++14 and C++11. In fact, I found this comment: 
This is a backwards-incompatible change that is applied to all language versions that allow type deduction from auto (per the request of the C++ committee).

Can someone please confirm and explain why the C++ committee requested compiler developers to treat this new rule as a Defect Report and, hence, to fix/change it also in C++11 and C++14?

Ville Voutilainen's n3912.html gives more information on that.

n3681.html mentions the example of init-captures.  Using the original wording of C++14, `[a{b}]` would not have deduced `a` as a copy of `b`, although it was the intent of "uniform initialization" that it should do so.  When the rules as written fail to capture the intent in basic cases, the committee might consider it a defect, as in this case.

-- James

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev