http://llvm.org/bugs/show_bug.cgi?id=10879

           Summary: Possibly mismatched push_back/pop_back in
                    SemaTemplateInstantiate.cpp
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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.

liulk

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to