This is the mail archive of the gcc-patches@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]

Re: [patch] Fix PR c++/28053


Lee Millward wrote:

cp/
2006-10-20  Lee Millward  <lee.millward@codesourcery.com>
           Mark Mitchell <mark@codesourcery.com>

       PR c++/28053
       * decl2.c (grokbitfield): Detect invalid non-integral
       types earlier when possible.

testsuite/
2006-10-18  Lee Millward  <lee.millward@codesourcery.com>

       PR c++/28053
       * g++.dg/parse/bitfield1.C: Adjust error markers.
       * g++.dg/parse/bitfield2.C: New test.

+template <typename T>
+struct E
+{
+  T* t : 3;             // { dg-error "function" }
+};

That error's not coming from the new check you added. In retrospect, that makes sense: the parser knows that "*" is part of a declarator, and that this isn't a bitfield anyhow. However, I still think the POINTER_TYPE_P check is useful, since it will catch:


  template <typename T>
  struct A {
    typedef T *U;
    U u : 3;
  };

which has a syntactically acceptable form for a bitfield.

:REVIEWMAIL: OK

Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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