[LLVMbugs] [Bug 10879] New: Possibly mismatched push_back/pop_back in SemaTemplateInstantiate.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 6 21:14:25 PDT 2011


           Summary: Possibly mismatched push_back/pop_back in
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: liulk at likai.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Created an attachment (id=7232)
 --> (http://llvm.org/bugs/attachment.cgi?id=7232)
An example showing template instantiation stack bleed.

There is an error in the template instantiation stack. The symptom is somewhat
misleading. Running clang++ against the attached example gives you this error:

clang-sync-tying.cc:27:38: error: cannot initialize a parameter of type
      'volatile char *' with an rvalue of type 'ValueType *' (aka 'void **')
    if (__sync_bool_compare_and_swap(&Self()->Value(), that.Value(), expect)) {
clang-sync-tying.cc:55:12: note: in instantiation of member function
      'CompareSwapImpl<CompareSwappableValue<void *>, void *>::CompareSwap'
      requested here
  csv_ptr1.CompareSwap(csv_ptr2, (void *) 1u);
1 error generated.

The instantiation here should find the first argument to
__sync_bool_compare_and_swap() the type of void *volatile *, not volatile char
*. The type volatile char * comes from the previous instantiation.


Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list