[cfe-commits] r165091 - /cfe/trunk/lib/AST/MicrosoftMangle.cpp

Aaron Ballman aaron at aaronballman.com
Wed Oct 3 05:05:44 PDT 2012


On Wed, Oct 3, 2012 at 2:12 AM, Nico Weber <nicolasweber at gmx.de> wrote:
> Author: nico
> Date: Wed Oct  3 01:12:27 2012
> New Revision: 165091
>
> URL: http://llvm.org/viewvc/llvm-project?rev=165091&view=rev
> Log:
> Replace a default: with an explicit list of cases. No functionality change.
>
> Modified:
>     cfe/trunk/lib/AST/MicrosoftMangle.cpp
>
> Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=165091&r1=165090&r2=165091&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
> +++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Wed Oct  3 01:12:27 2012
> @@ -810,7 +810,12 @@
>          break;
>        }
>        /* fallthrough */
> -    } default: {
> +    }
> +    case TemplateArgument::Template:
> +    case TemplateArgument::TemplateExpansion:
> +    case TemplateArgument::Declaration:
> +    case TemplateArgument::NullPtr:
> +    case TemplateArgument::Pack: {
>        // Issue a diagnostic.
>        DiagnosticsEngine &Diags = Context.getDiags();
>        unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,

Now if another value is added to the list, it will silently fail; is
this acceptable?  I would feel more comfortable if there was still a
default case that would be marked as unreachable.

~Aaron



More information about the cfe-commits mailing list