I'm trying to combine gcc's compile-time checking of printf format strings with c++11's variadic template packs.
I know I can decorate a variadic function with gcc's __attribute__((format(__printf__, ...)) decorator.
I know I can expand a variadic template pack into a variadic function. eg: printf(fmt, pack...);
Is it possible to combine the two?
In this question the accepted answer notes that gcc requires literals for the format check to work.
In the example below a const char array is passed to both the variadic function and the variadic function template. gcc can tell it is a literal when check is called in main, but not from check_t
Is there any way to pass the fmt string to check_t in such a way that gcc sees it as a literal? 
Working example of what I'm trying to achieve:
#include <iostream>
void check(const char*, ...) __attribute__((format(__printf__, 1, 2)));
void check(const char*, ...)
{ 
    // exists only for the purposes of catching bogus format strings
}
template<typename... Ts>
void check_t(const char fmt[], Ts... ts)
{
    // check the format string by expanding ts into the check function
    check(fmt, ts...);
}
int main()
{
    const char f[] = "foo %s";
    check_t(f, 5);              // compiles
    check(f, 5);                // fails to compile
    return 0;
}