<html>
    <head>
      <base href="http://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 --- - If a keyword reverts to an identifier, things don't get serialized right to a PCH file"
   href="http://llvm.org/bugs/show_bug.cgi?id=21036">21036</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>If a keyword reverts to an identifier, things don't get serialized right to a PCH file
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13067" name="attach_13067" title="failing test">attachment 13067</a> <a href="attachment.cgi?id=13067&action=edit" title="failing test">[details]</a></span>
failing test

Consider:

Nicos-MacBook-Pro:Release thakis$ cat test.h
namespace foo {
template <typename _Tp>
struct __is_pod {
  enum {
    __value = 1
  };
};
}
Nicos-MacBook-Pro:Release thakis$ cat test.cc
template <typename T>
struct my_is_pod {
  static const bool value = __is_pod(T);
};

int f() {
  return my_is_pod<int>::value;
}
Nicos-MacBook-Pro:Release thakis$ clang -x c++-header test.h -o test.h.gch
-stdlib=libstdc++
Nicos-MacBook-Pro:Release thakis$ clang -include test.h -c test.cc
-stdlib=libstdc++
test.cc:3:38: error: 'T' does not refer to a value
  static const bool value = __is_pod(T);
                                     ^
test.cc:1:20: note: declared here
template <typename T>
                   ^
1 error generated.


But this passes:

Nicos-MacBook-Pro:Release thakis$ rm test.h.gch 
Nicos-MacBook-Pro:Release thakis$ clang -c test.cc -std=c++11 -include test.h
In file included from <built-in>:188:
In file included from <command line>:1:
test.h:3:8: warning: keyword '__is_pod' will be made available as an identifier
for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod {
       ^
1 warning generated.


r110868 looks like it fixed this in the other direction, and
test/PCH/cxx-traits.cpp tests that other direction. The attached patch adds a
test (but not a fix) for the still-buggy direction described above.</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>