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++/17693] New: Error message enhancement


This test case has two erros:

namespace A
{
  typedef int my_test; 

  template <typename T> 
  void g () 
  {  
    T::a; 
  }

  void f () 
  { 
    g<my_test>(); 
  }
}

namespace B
{
  typedef char mysize_t;
  
  void g (void *, mysize_t)
  { }
  
  template <typename T, typename U>
  void f (T x, U y)
  {
    g (y, x);
  }
  
  void h ()
  {
    f (0, static_cast<mysize_t>(1));
  }
}

wilx@logout:::~/podpos> g++ -W -Wall -ansi -pedantic -c dedtest.cxx
dedtest.cxx: In function `void A::g() [with T = A::my_test]':
dedtest.cxx:13:   instantiated from here
dedtest.cxx:8: error: `a' is not a member of `A::my_test'
dedtest.cxx: In function `void B::f(T, U) [with T = int, U = char]':
dedtest.cxx:32:   instantiated from here
dedtest.cxx:27: error: invalid conversion from `char' to `void*'

The first one produces error message that uses the typedef'ed name: [with T =
A::my_test]
The second one produces error message that doesn't use the typedef'ed name:
[with T = int, U = char]
It would be really nice to see the typedef'ed name in the second error message too.

-- 
           Summary: Error message enhancement
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
                CC: gcc-bugs at gcc dot gnu dot org,v dot haisman at sh dot
                    cvut dot cz


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


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