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++/13452] New: No error on invalid (I think) C++ code


This code is compiled without error in the current mainline:

class C { public: template<typename i> int (*f())() const; };

However, it now seems to me that there should be an error on the trailing const.
 Otherwise, I have no idea what the trailing const means.  It appears that
generating a const method (i.e., a method for which `this' is a pointer to
const) requires

class C { public: template<typename i> int (*f() const)(); };

This may be a misunderstanding on my part, but at least some people share my
misunderstanding; see PR c++/13447.

-- 
           Summary: No error on invalid (I think) C++ code
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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