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: unassig...@gcc.gnu.org
        ReportedBy: m8r-gt1...@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.

Reply via email to