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++/70943] Bogus 'conflicting declaration' error with repeated typedefs in function templates


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-05-06
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |4.5.3, 4.8.3, 4.9.3, 5.3.0,
                   |                            |6.1.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  The following C++ 98 test case is also rejected with similar
errors, going as far back as 4.5.3. 

template <class T>
void foo (T) {
    typedef T X;
    typedef int X;

    extern T bar ();
    extern int bar ();
}

template void foo (int);
xxx.c: In function âvoid foo(T)â:
xxx.c:4:17: error: conflicting declaration âtypedef int Xâ
     typedef int X;
                 ^
xxx.c:3:15: note: previous declaration as âtypedef T Xâ
     typedef T X;
               ^
xxx.c:7:16: error: ambiguating new declaration of âint bar()â
     extern int bar ();
                ^~~
xxx.c:6:14: note: old declaration âT bar()â
     extern T bar ();
              ^~~

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