On Wed, Oct 3, 2012 at 9:05 PM, Aaron Ballman <[email protected]> wrote:
> On Wed, Oct 3, 2012 at 2:12 AM, Nico Weber <[email protected]> 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.

It won't silently fail, clang will warn that a enum case isn't handled.

>
> ~Aaron
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to