This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70943] Bogus 'conflicting declaration' error with repeated typedefs in function templates
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 May 2016 20:02:00 +0000
- Subject: [Bug c++/70943] Bogus 'conflicting declaration' error with repeated typedefs in function templates
- Auto-submitted: auto-generated
- References: <bug-70943-4 at http dot gcc dot gnu dot org/bugzilla/>
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 ();
^~~