This is an unfixed DDOC bug: /** */ struct AtoiT(T) { static if (!is (T == char) && !is (T == wchar)) pragma (msg, "Template type must be char or wchar"); } dmd -D "Error: static if conditional cannot be at global scope"