[PATCH] Provide fixit if unscoped enumeration is used in nested name specifier. This fixes PR16951.

Serge Pavlov sepavloff at gmail.com
Thu Jan 15 07:46:23 PST 2015


MSVC supported using an enumerator as a nested-name-specifier for a long time. For instance, VS2005 compiled the code:

  enum ABCD { A, B, C };
  
  int main() {
    return ABCD::A;
  }

without errors:

  C:\Tools>cl tt.cpp
  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  tt.cpp
  tt.cpp(4) : warning C4482: nonstandard extension used: enum 'ABCD' used in qualified name
  Microsoft (R) Incremental Linker Version 8.00.50727.42
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  /out:tt.exe
  tt.obj
  
  C:\Tools>

VS2010 compiles this code without warnings by default. It is reasonable to accept this code in Microsoft mode without warnings by default, isn't it?

However, complaining on using extension make the patch simpler, will update it.


http://reviews.llvm.org/D6389

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list