public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53566] New: void template parameters are accepted if they result from substitution
@ 2012-06-03 16:51 M8R-gt1qwe at spamherelots dot com
  2021-07-31 20:41 ` [Bug c++/53566] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: M8R-gt1qwe at spamherelots dot com @ 2012-06-03 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53566
           Summary: void template parameters are accepted if they result
                    from substitution
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: M8R-gt1qwe@spamherelots.com


GCC incorrectly accepts the following program (-std=c++11 -Wall -Wextra
-pedantic):

#include <type_traits>

template <typename T,
           typename std::enable_if<std::is_reference<T>::value>::type...>
void f() {}
template <typename T,
           typename std::enable_if<!std::is_reference<T>::value>::type...>
void f() {}

int main() {
    f<int>();
    f<int&>();
}

It should not accept it because substitution results in a void... template
parameter pack, which is not allowed.


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

* [Bug c++/53566] void template parameters are accepted if they result from substitution
  2012-06-03 16:51 [Bug c++/53566] New: void template parameters are accepted if they result from substitution M8R-gt1qwe at spamherelots dot com
@ 2021-07-31 20:41 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-31 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
clang accepts this code too.

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

end of thread, other threads:[~2021-07-31 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-03 16:51 [Bug c++/53566] New: void template parameters are accepted if they result from substitution M8R-gt1qwe at spamherelots dot com
2021-07-31 20:41 ` [Bug c++/53566] " 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).