public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34667] New: Ambiguous error message on partial member specialization
@ 2008-01-04 1:49 philippe at fornux dot com
2008-01-04 9:47 ` [Bug c++/34667] " rguenth at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: philippe at fornux dot com @ 2008-01-04 1:49 UTC (permalink / raw)
To: gcc-bugs
The following code will not compile even if the error message doesn't make
sense, because it obviously knows which member to instantiate.
This may be a compiler bug issue, or and ambiguous error message.
#include <iostream>
using namespace std;
template <typename T>
class vector
{
vector();
public:
template <unsigned S>
vector(T (& array) [S])
{
cout << sizeof(array) / sizeof(T) << endl;
}
};
int main()
{
vector<int> a((int []) {0, 1, 2, 4, 5});
}
$ g++ temp.cpp
temp.cpp: In function `int main()':
temp.cpp:22: error: no matching function for call to
`vector<int>::vector(int[5])'
temp.cpp:9: note: candidates are: vector<int>::vector(const vector<int>&)
temp.cpp:15: note: vector<T>::vector(T (&)[S]) [with unsigned
int S = 5u, T = int]
temp.cpp:10: note: vector<T>::vector() [with T = int]
--
Summary: Ambiguous error message on partial member specialization
Product: gcc
Version: 3.4.6
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe at fornux dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34667
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/34667] Ambiguous error message on partial member specialization
2008-01-04 1:49 [Bug c++/34667] New: Ambiguous error message on partial member specialization philippe at fornux dot com
@ 2008-01-04 9:47 ` rguenth at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-04 9:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-01-04 09:32 -------
Fixed on the 4.1 release branch and as of (at least) 4.2.2.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Known to work| |4.1.3 4.2.2
Resolution| |FIXED
Target Milestone|--- |4.2.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34667
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-04 9:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-04 1:49 [Bug c++/34667] New: Ambiguous error message on partial member specialization philippe at fornux dot com
2008-01-04 9:47 ` [Bug c++/34667] " rguenth at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).