summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2012-12-05 22:15:23 (EST)
committerSergey Prigogin2012-12-07 15:02:30 (EST)
commit1289cc3a6e98b216ce687901dbc9fcca1c441e30 (patch)
tree450d5bcbb1f6fadee7dcdb8884f211ce3ff52fc3
parentbb97b889b255fe35d40995726ff87f1d0f0a4f6c (diff)
downloadorg.eclipse.cdt-1289cc3a6e98b216ce687901dbc9fcca1c441e30.zip
org.eclipse.cdt-1289cc3a6e98b216ce687901dbc9fcca1c441e30.tar.gz
org.eclipse.cdt-1289cc3a6e98b216ce687901dbc9fcca1c441e30.tar.bz2
Bug 365498 - Strange warning placement for defaulted constructor
Change-Id: Ia80fbd9694310aff0900e80cb9175e101c653604 Reviewed-on: https://git.eclipse.org/r/9065 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java2
2 files changed, 10 insertions, 1 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java
index 0f1faae..ed41608 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java
@@ -577,4 +577,13 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
runOnProject();
checkNoErrors();
}
+
+ // struct S {
+ // int i;
+ // S() = default;
+ // };
+ public void testBug365498_defaultedConstructor() throws Exception{
+ loadCodeAndRun(getAboveComment());
+ checkErrorLine(3);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
index 9d4c8d4..c63322a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
@@ -2521,7 +2521,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
default:
throwBacktrack(kind);
}
- return adjustEndOffset(fdef, consume(IToken.tSEMI).getEndOffset());
+ return setRange(fdef, firstOffset, consume(IToken.tSEMI).getEndOffset());
}
if (LT(1) == IToken.tCOLON) {