summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticSemaKinds.td
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2014-12-14 01:46:53 +0000
committerJohn McCall <rjmccall@apple.com>2014-12-14 01:46:53 +0000
commitba912273288ce8963808816565faf7cad6a09b69 (patch)
tree14df3a0607b69963fc929c2afa041673157fb291 /include/clang/Basic/DiagnosticSemaKinds.td
parent81fcac72061abd5a6e16184394357bf18f2321e3 (diff)
If a non-template constructor instantiated to X(X),
ignore it during overload resolution when initializing X from a value of type cv X. Previously, our rule here only ignored specializations of constructor templates. That's probably because the standard says that constructors are outright ill-formed if their first parameter is literally X and they're callable with one argument. However, Clang only enforces that prohibition against non-implicit instantiations; I'm not sure why, but it seems to be deliberate. Given that, the most sensible thing to do is to just ignore the "illegal" constructor regardless of where it came from. Also, stop ignoring such constructors silently: print a note explaining why they're being ignored. Fixes <rdar://19199836>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticSemaKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 48fdf6f826..32bf1b067b 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2847,6 +2847,9 @@ def note_ovl_candidate : Note<"candidate "
"|volatile and restrict|const, volatile, and restrict}4)}2">;
def note_ovl_candidate_inherited_constructor : Note<"inherited from here">;
+def note_ovl_candidate_illegal_constructor : Note<
+ "candidate %select{constructor|template}0 ignored: "
+ "instantiation %select{takes|would take}0 its own class type by value">;
def note_ovl_candidate_bad_deduction : Note<
"candidate template ignored: failed template argument deduction">;
def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "