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++/61355] New: gcc doesn't normalize type in non-type template parameters


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61355

            Bug ID: 61355
           Summary: gcc doesn't normalize type in non-type template
                    parameters
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vanyacpp at gmail dot com

template<class T, T I>
struct X {
};

int test() {
    X<int(), test> x;
}

GCC rejects this code with a message:

3.cpp: In function âint test()â:
3.cpp:6:18: error: âint()â is not a valid type for a template non-type
parameter
     X<int(), test> x;
                  ^
3.cpp:6:21: error: invalid type in declaration before â;â token
     X<int(), test> x;
                     ^

I believe type int() should be normalized to int (*)().

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