Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2015-12-17 23:50:14 -0500
committerSergey Prigogin2015-12-23 23:30:15 -0500
commit59de5c303fa4acb288a734742afc6ea017579225 (patch)
tree6e35d056a80ee9dc5a074dc9949743ce69bb423a /codan/org.eclipse.cdt.codan.core.test
parent8ceb33a1fcff181faaaede0887780dc81ee1d10f (diff)
downloadorg.eclipse.cdt-59de5c303fa4acb288a734742afc6ea017579225.tar.gz
org.eclipse.cdt-59de5c303fa4acb288a734742afc6ea017579225.tar.xz
org.eclipse.cdt-59de5c303fa4acb288a734742afc6ea017579225.zip
Bug 484619 - Make sure ProblemBindingChecker reports unresolved
user-defined literal operators Change-Id: Idbb157c33b3aae06a00a10f7e7836e96db9f9b63 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.test')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java
index 3e250a259c..67cbccdada 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java
@@ -95,4 +95,18 @@ public class ProblemBindingCheckerTest extends CheckerTestCase {
IMarker marker = checkErrorLine(3, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem);
assertFalse(marker.getAttribute(IMarker.MESSAGE, "").contains("MACRO")); //$NON-NLS-1$//$NON-NLS-2$
}
+
+ // auto d = 42_waldo;
+ public void testNonexistentUDLOperator_484619() {
+ loadCodeAndRun(getAboveComment());
+ checkErrorLine(1, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem);
+ }
+
+ // struct R {};
+ // R operator "" _waldo(const char*, unsigned long); // expects a string literal
+ // auto d = 42_waldo; // passing an integer
+ public void testUDLOperatorWithWrongType_484619() {
+ loadCodeAndRun(getAboveComment());
+ checkErrorLine(3, ProblemBindingChecker.ERR_ID_InvalidArguments);
+ }
}

Back to the top