OSDN Git Service

C++ function signature: Allow most specifiers to be replaced.
authorChristian Kamm <christian.d.kamm@nokia.com>
Tue, 13 Sep 2011 09:36:05 +0000 (11:36 +0200)
committerChristian Kamm <christian.d.kamm@nokia.com>
Tue, 13 Sep 2011 09:50:06 +0000 (11:50 +0200)
Except for some SimpleSpecifiers and AttributeSpecifiers. Fixes a bug
where NamedTypeSpecifiers would not be replaced when the return type
was adjusted.

Change-Id: Ie093615ebf1b26d181b888fcbcc341e5bdf85fd1
Reviewed-on: http://codereview.qt-project.org/4749
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
src/plugins/cppeditor/cppfunctiondecldeflink.cpp

index a228e6a..c4facf3 100644 (file)
@@ -455,7 +455,9 @@ static bool canReplaceSpecifier(TranslationUnit *translationUnit, SpecifierAST *
             return false;
         }
     }
-    return false;
+    if (specifier->asAttributeSpecifier())
+        return false;
+    return true;
 }
 
 static SpecifierAST *findFirstReplaceableSpecifier(TranslationUnit *translationUnit, SpecifierListAST *list)