r198326 - Using the quoted version of an attribute name for consistency with other attribute diagnostics.

Aaron Ballman aaron at aaronballman.com
Thu Jan 2 10:10:17 PST 2014


Author: aaronballman
Date: Thu Jan  2 12:10:17 2014
New Revision: 198326

URL: http://llvm.org/viewvc/llvm-project?rev=198326&view=rev
Log:
Using the quoted version of an attribute name for consistency with other attribute diagnostics.

Modified:
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/test/Parser/attributes.c

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=198326&r1=198325&r2=198326&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Thu Jan  2 12:10:17 2014
@@ -1123,7 +1123,7 @@ void Parser::ParseLexedAttribute(LatePar
     // FIXME: Do not warn on C++11 attributes, once we start supporting
     // them here.
     Diag(Tok, diag::warn_attribute_on_function_definition)
-      << LA.AttrName.getName();
+      << &LA.AttrName;
   }
 
   ParsedAttributes Attrs(AttrFactory);

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=198326&r1=198325&r2=198326&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Thu Jan  2 12:10:17 2014
@@ -1053,7 +1053,7 @@ Decl *Parser::ParseFunctionDefinition(Pa
       if (!IsThreadSafetyAttribute(DtorAttrs->getName()->getName()) &&
           !DtorAttrs->isCXX11Attribute()) {
         Diag(DtorAttrs->getLoc(), diag::warn_attribute_on_function_definition)
-          << DtorAttrs->getName()->getName();
+          << DtorAttrs->getName();
       }
       DtorAttrs = DtorAttrs->getNext();
     }

Modified: cfe/trunk/test/Parser/attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/attributes.c?rev=198326&r1=198325&r2=198326&view=diff
==============================================================================
--- cfe/trunk/test/Parser/attributes.c (original)
+++ cfe/trunk/test/Parser/attributes.c Thu Jan  2 12:10:17 2014
@@ -65,27 +65,27 @@ int __attribute__((format(printf, 0 alig
 
 
 int testFundef1(int *a) __attribute__((nonnull(1))) { // \
-    // expected-warning {{GCC does not allow nonnull attribute in this position on a function definition}}
+    // expected-warning {{GCC does not allow 'nonnull' attribute in this position on a function definition}}
   return *a;
 }
 
 // noreturn is lifted to type qualifier
 void testFundef2() __attribute__((noreturn)) { // \
-    // expected-warning {{GCC does not allow noreturn attribute in this position on a function definition}}
+    // expected-warning {{GCC does not allow 'noreturn' attribute in this position on a function definition}}
   testFundef2();
 }
 
 int testFundef3(int *a) __attribute__((nonnull(1), // \
-    // expected-warning {{GCC does not allow nonnull attribute in this position on a function definition}}
+    // expected-warning {{GCC does not allow 'nonnull' attribute in this position on a function definition}}
                                      pure)) { // \
-    // expected-warning {{GCC does not allow pure attribute in this position on a function definition}}
+    // expected-warning {{GCC does not allow 'pure' attribute in this position on a function definition}}
   return *a;
 }
 
 int testFundef4(int *a) __attribute__((nonnull(1))) // \
-    // expected-warning {{GCC does not allow nonnull attribute in this position on a function definition}}
+    // expected-warning {{GCC does not allow 'nonnull' attribute in this position on a function definition}}
                       __attribute((pure)) { // \
-    // expected-warning {{GCC does not allow pure attribute in this position on a function definition}}
+    // expected-warning {{GCC does not allow 'pure' attribute in this position on a function definition}}
   return *a;
 }
 





More information about the cfe-commits mailing list