Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2009-08-10 00:41:51 -0400
committerSergey Prigogin2009-08-10 00:41:51 -0400
commit6d379502bc9d0bf29d3d1930b06aad433b9c2b58 (patch)
tree0645c7e532037ee9861da3e38bfb313a31598bfc /core
parenta5e5281adedad1144177ad1dd2d559379bc2e552 (diff)
downloadorg.eclipse.cdt-6d379502bc9d0bf29d3d1930b06aad433b9c2b58.tar.gz
org.eclipse.cdt-6d379502bc9d0bf29d3d1930b06aad433b9c2b58.tar.xz
org.eclipse.cdt-6d379502bc9d0bf29d3d1930b06aad433b9c2b58.zip
Resolution of inline friend functions from index.. Bug 284690.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java12
2 files changed, 23 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java
index d29962df95..87dcc20d3b 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java
@@ -1357,6 +1357,17 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
getBindingFromASTName("A a", 1, ICPPClassType.class);
}
+ // class A {
+ // friend inline void m(A p) {}
+ // };
+
+ // void test(A a) {
+ // m(a);
+ // }
+ public void testInlineFriendFunction_284690() throws Exception {
+ getBindingFromASTName("m(a)", 1, ICPPFunction.class);
+ }
+
private void checkValue(IValue initialValue, int i) {
assertNotNull(initialValue);
final Long numericalValue = initialValue.numericalValue();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
index 9fde713b53..45331c5bbf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
@@ -2052,6 +2052,18 @@ public class CPPVisitor extends ASTQueries {
if (declSpec.isFriend()) {
isFriend= true;
}
+ } else if (node instanceof IASTFunctionDefinition) {
+ IASTFunctionDefinition funcDefinition = (IASTFunctionDefinition) node;
+ ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) funcDefinition.getDeclSpecifier();
+ if (declSpec.isFriend()) {
+ isFriend= true;
+ }
+ } else if (node instanceof IASTFunctionDefinition) {
+ IASTFunctionDefinition funcDefinition = (IASTFunctionDefinition) node;
+ ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) funcDefinition.getDeclSpecifier();
+ if (declSpec.isFriend()) {
+ isFriend= true;
+ }
}
// Search for enclosing binding

Back to the top