def METHOD_NAME(cls, cc):
    """Older versions of gcc use the ``-dumpversion`` option.
    Output looks like this::
        4.4.7
    In GCC 7, this option was changed to only return the major
    version of the compiler::
        7
    A new ``-dumpfullversion`` option was added that gives us
    what we want::
        7.2.0
    """
    # Apple's gcc is actually apple clang, so skip it. Returning
    # "unknown" ensures this compiler is not detected by default.
    # Users can add it manually to compilers.yaml at their own risk.
    if apple_clang.AppleClang.METHOD_NAME(cc) != "unknown":
        return "unknown"
    version = super(Gcc, cls).METHOD_NAME(cc)
    if Version(version) >= Version("7"):
        output = spack.compiler.get_compiler_version_output(cc, "-dumpfullversion")
        version = cls.extract_version_from_output(output)
    return version