<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang incorrectly emits definition for undefined constexpr static data member."
   href="https://llvm.org/bugs/show_bug.cgi?id=28390">28390</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang incorrectly emits definition for undefined constexpr static data member.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>eric@efcs.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reproducer:
//---------------------
struct Foo {
 static const bool undefined = true; // still is correctly undefined
 static constexpr bool incorrectly_defined = true; // clang emits a definition
};
void test(const bool&) {}
int main() {
    test(Foo::incorrectly_defined); // shouldn't link
    // test(Foo::undefined); // doesn't link
}
//------------------------

Clang has started emitting a definition for "incorrectly_defined", this means
the above test case compiles and links successfully when it could fail to
compile. It also causes ODR violations when "incorrectly_defined" is actually
defined in another TU.

Note that Clang did not emit a definition for this code in 3.8, and I think it
started within the last two weeks, since that's when I started noticing errors.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>