[cfe-commits] r142566 - /cfe/trunk/lib/Sema/SemaDecl.cpp

David Blaikie dblaikie at gmail.com
Wed Oct 19 19:49:08 PDT 2011


Author: dblaikie
Date: Wed Oct 19 21:49:08 2011
New Revision: 142566

URL: http://llvm.org/viewvc/llvm-project?rev=142566&view=rev
Log:
FixIt insert 'static' for anonymous unions at global or namespace scope.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=142566&r1=142565&r2=142566&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Oct 19 21:49:08 2011
@@ -2653,7 +2653,8 @@
           (isa<TranslationUnitDecl>(Owner) ||
            (isa<NamespaceDecl>(Owner) &&
             cast<NamespaceDecl>(Owner)->getDeclName()))) {
-        Diag(Record->getLocation(), diag::err_anonymous_union_not_static);
+        Diag(Record->getLocation(), diag::err_anonymous_union_not_static)
+          << FixItHint::CreateInsertion(Record->getLocation(), "static ");
         Invalid = true;
   
         // Recover by adding 'static'.





More information about the cfe-commits mailing list