Generalized GCD domains