public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57919] New: [C++11] Alias templates cause partial specialization to erroneously fail
@ 2013-07-17 13:19 cheesear at gmail dot com
2014-11-23 15:00 ` [Bug c++/57919] " paolo.carlini at oracle dot com
2023-01-20 22:05 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: cheesear at gmail dot com @ 2013-07-17 13:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57919
Bug ID: 57919
Summary: [C++11] Alias templates cause partial specialization
to erroneously fail
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cheesear at gmail dot com
Created attachment 30516
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30516&action=edit
MWE that causes the aforementioned error.
The use of alias templates can cause the compiler to think that a valid
template class instantiation is ambiguous. The file attached contains an
example that, when compiled with g++ (version 4.8.1_1 from Macports), results
in the following error:
$ g++ -std=c++11 er.cpp
er.cpp: In function 'int main()':
er.cpp:39:41: error: ambiguous class template instantiation for 'struct foo<1,
1, sequence<> >'
using t = typename foo<1, 1, extents<>>::type;
^
er.cpp:26:8: error: candidates are: struct foo<A, B, sequence<integer<Ts>...> >
struct foo<A, B, extents<Ts...>>
^
er.cpp:32:8: error: struct foo<B, B, sequence<integer<Ts>...> >
struct foo<B, B, extents<Ts...>>
^
er.cpp:39:43: error: 'type' in 'struct foo<1, 1, sequence<> >' does not name a
type
using t = typename foo<1, 1, extents<>>::type;
^
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/57919] [C++11] Alias templates cause partial specialization to erroneously fail
2013-07-17 13:19 [Bug c++/57919] New: [C++11] Alias templates cause partial specialization to erroneously fail cheesear at gmail dot com
@ 2014-11-23 15:00 ` paolo.carlini at oracle dot com
2023-01-20 22:05 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-23 15:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57919
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-11-23
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/57919] [C++11] Alias templates cause partial specialization to erroneously fail
2013-07-17 13:19 [Bug c++/57919] New: [C++11] Alias templates cause partial specialization to erroneously fail cheesear at gmail dot com
2014-11-23 15:00 ` [Bug c++/57919] " paolo.carlini at oracle dot com
@ 2023-01-20 22:05 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-20 22:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57919
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC also rejects this code for the same reason as GCC:
<source>(32): error C2752: 'foo<1,1,sequence<>>': more than one partial
specialization matches the template argument list
<source>(19): note: could be 'foo<A,B,sequence<integer<Ts>...>>'
<source>(25): note: or 'foo<B,B,sequence<integer<Ts>...>>'
<source>(32): error C2027: use of undefined type 'foo<1,1,sequence<>>'
<source>(32): note: see declaration of 'foo<1,1,sequence<>>'
<source>(32): error C2061: syntax error: identifier 'type'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-20 22:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17 13:19 [Bug c++/57919] New: [C++11] Alias templates cause partial specialization to erroneously fail cheesear at gmail dot com
2014-11-23 15:00 ` [Bug c++/57919] " paolo.carlini at oracle dot com
2023-01-20 22:05 ` pinskia at gcc dot gnu.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).