This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33101] [DR 577] allow typedefs for void in empty parameter list


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33101

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |rejects-valid
            Summary|[DR 577] Bad C++ error on   |[DR 577] allow typedefs for
                   |invalid code: <anonymous>   |void in empty parameter
                   |has incomplete type         |list

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-16 20:37:33 UTC ---
(In reply to comment #10)
> I agree that the C++ standard's wording is ambiguous, and *could*
> be read as requiring the keyword "void", but I believe the intent
> is to permit a typedef.  (And if you want to argue that the use of
> a typedef is silly, I agree completely.)
> 
> I believe that the resolution of DR 577:
>     http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#577
> confirms this. 

No, that issue confirms quite clearly that before that change (which only
happened last month and is not part of C++98, C++03 or C++11) the code was
definitely invalid:

"The C99 formulation allows typedefs for void, while C++ (and C90) accept only
the keyword itself in this role."

The language was not ambiguous and the intent wasn't clarified by DR 577, the
rule was changed so previously invalid code is now valid.

Subject and keywords changed to match the new status.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]