summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2012-12-05 22:15:23 (EST)
committerSergey Prigogin2012-12-06 21:22:45 (EST)
commit8cf540fbf6f9d5bcb5a8387b63bfd6c281f0784a (patch)
tree23d2fb1c2963c84d556006adacb1b44d7a9fe8e9
parentb2238a81f489d728d8bea2cec1aded0208c372ce (diff)
downloadorg.eclipse.cdt-8cf540fbf6f9d5bcb5a8387b63bfd6c281f0784a.zip
org.eclipse.cdt-8cf540fbf6f9d5bcb5a8387b63bfd6c281f0784a.tar.gz
org.eclipse.cdt-8cf540fbf6f9d5bcb5a8387b63bfd6c281f0784a.tar.bz2
Bug 365498 - Strange warning placement for defaulted constructorrefs/changes/65/9065/3
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 b7082f7..6f3083e 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
@@ -2528,7 +2528,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) {