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++/33747] New: [diagnostics] don't report default template parameters.


please consider following testcase:

$ cat t.cpp
#include <set>
#include <string>
template < typename T, typename S = std::set< std::string >, int N = 1 >
struct X
{
        virtual ~X() = 0;
};
void f()
{
        X< float > x;  // error here.
}

in the standard way g++ reports all template arguments
in diagnostics messages.

$ g++ t.cpp -Wall -c
t.cpp: In function 'void f()':
t.cpp:10: error: cannot declare variable 'x' to be of abstract type 'X<float,
std::set<std::string, std::less<std::string>, std::allocator<std::string> >,
1>'
t.cpp:5: note:   because the following virtual functions are pure within
'X<float, std::set<std::string, std::less<std::string>,
std::allocator<std::string> >, 1>':
t.cpp:6: note:  X<T, S, N>::~X() [with T = float, S = std::set<std::string,
std::less<std::string>, std::allocator<std::string> >, int N = 1]

it hurts my eyes to read this.
tons of expanded arguments in boost/stlport diagnostics aren't so funny ;)
it would nice to see a magic -Whuman-readable;) option to enable more
human readable reporting, e.g.:

t.cpp: In function 'void f()':
t.cpp:10: error: cannot declare variable 'x' to be of abstract
                 type 'X<float, [defaults]>'
t.cpp:5: note:   because the following virtual functions are pure
                 within 'X<float, [defaults]>':
t.cpp:6: note:  X<T, S, N>::~X() [with T = float, [defaults]]

is it possible to implement this in easy way?


-- 
           Summary: [diagnostics] don't report default template parameters.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net


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


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