Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMarco Stornelli2019-03-19 15:34:27 -0400
committerMarco Stornelli2019-03-21 15:41:26 -0400
commitf2635eed74b108675d48c215e7ebc5d20773910b (patch)
treed7d9064051c0f7b75d4fe76e3716d8462b20e6dc /core
parente70a63a424a193df50810f497bc2365d9f8796be (diff)
downloadorg.eclipse.cdt-f2635eed74b108675d48c215e7ebc5d20773910b.tar.gz
org.eclipse.cdt-f2635eed74b108675d48c215e7ebc5d20773910b.tar.xz
org.eclipse.cdt-f2635eed74b108675d48c215e7ebc5d20773910b.zip
Bug 545562 - Fix return checker check for template functions
Change-Id: Ie5e3d4560cb3784f6c8393290d64794db56294d7 Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java7
2 files changed, 5 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java
index bc9cd9b9ac..5f6de12389 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java
@@ -734,7 +734,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
@Override
public boolean isNoReturn() {
- ICPPASTFunctionDeclarator dtor = getPreferredDtor();
+ return isNoReturn(getPreferredDtor());
+ }
+
+ public static boolean isNoReturn(ICPPASTFunctionDeclarator dtor) {
if (dtor == null) {
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java
index 9ed186ffce..a5e631763e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java
@@ -36,7 +36,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
-import org.eclipse.cdt.core.parser.util.AttributeUtil;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
@@ -390,11 +389,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
@Override
public boolean isNoReturn() {
- ICPPASTFunctionDeclarator fdecl = getFirstFunctionDtor();
- if (fdecl != null) {
- return AttributeUtil.hasNoreturnAttribute(fdecl);
- }
- return false;
+ return CPPFunction.isNoReturn(getFirstFunctionDtor());
}
private IASTDeclarator getDeclaratorByName(IASTNode node) {

Back to the top