Open
Description
Bugzilla Link | 19923 |
Version | 3.4 |
OS | Linux |
Reporter | LLVM Bugzilla Contributor |
CC | @DougGregor |
Extended Description
In a class template, g++ instantiates member functions marked with [[gnu::used]]
even when those functions are used nowhere in the program. clang does not. This causes code to compile that doesn't compile on g++, e.g.
#include <type_traits>
template<class I>
class X {
[[gnu::used]]
static void check() {
static_assert(std::is_enum<I>::value, "");
}
};
X<int> x;