[Bug c++/12762] New: [3.4 regression] Much worse error message when using a typedef with a template arg

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Fri Oct 24 15:51:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] Much worse error message when using a
                    typedef with a template arg
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org,gdr at gcc dot gnu dot
                    org

This came out of PR 12507. Consider this code:
-------------------
template <typename> struct A { A() {}};
typedef A<int> Ac;
Ac<double> a;
-------------------
The fact the gcc3.3 accepts this is covered by PR 12507, but look
at the error message from 3.2.3 and present mainline:

g/x> /home/bangerth/bin/gcc-3.2.3/bin/c++ -c x.cc
x.cc:3: non-template type `Ac' used as a template
x.cc:3: ISO C++ forbids declaration of `a' with no type

g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:3: error: expected unqualified-id
x.cc:3: error: expected `,' or `;'

This is definitely a regression in quality of error reporting.

W.



More information about the Gcc-bugs mailing list