Fix g++ version detection
Fix IsConst trait for const pointers and references.