public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49051] New: Doesn't SFINAE away an invalid substitution into toplevel parameter type "T[N]"
@ 2011-05-18 20:20 schaub.johannes at googlemail dot com
  2011-05-18 22:18 ` [Bug c++/49051] [C++0x] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: schaub.johannes at googlemail dot com @ 2011-05-18 20:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49051

           Summary: Doesn't SFINAE away an invalid substitution into
                    toplevel parameter type "T[N]"
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


GCC incorrectly fails to compile this code

template<typename T> void f(T[1]) = delete; 
template<typename T> void f(...); 
int main() { f<void>(0); }

The substitution into "T" should fail, because "T[1]" is an invalid type, and
hence the call should use the second template. 

Note that I think it's unspecified in the spec what happens when we tweak
things as follows

template<typename T> void f(T[1]) = delete; 
template<typename T> void f(T*);
template<typename T> void f(...); 
int main() { f<void>(0); }

The first two templates are equivalent, but behave different during
substitution. The spec doesn't specify what the outcome of this is, I think.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-30 21:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 20:20 [Bug c++/49051] New: Doesn't SFINAE away an invalid substitution into toplevel parameter type "T[N]" schaub.johannes at googlemail dot com
2011-05-18 22:18 ` [Bug c++/49051] [C++0x] " paolo.carlini at oracle dot com
2011-05-19 16:23 ` jason at gcc dot gnu.org
2011-05-19 16:59 ` schaub.johannes at googlemail dot com
2011-05-19 17:21 ` schaub.johannes at googlemail dot com
2011-05-19 18:01 ` jason at gcc dot gnu.org
2011-06-26 13:40 ` schaub.johannes at googlemail dot com
2011-08-30 22:45 ` jason 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).