https://llvm.org/bugs/show_bug.cgi?id=22972

            Bug ID: 22972
           Summary: Clang misidentifies the parameter to blame in
                    out-of-line definition mismatch
           Product: clang
           Version: 3.6
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 14081
  --> https://llvm.org/bugs/attachment.cgi?id=14081&action=edit
A minimal program to reproduce the bug.

Overview:
---------

When an out-of-line definition of a method doesn't match the original
declaration with regards to parameter const qualifiers, Clang's explanation of
the situation incorrectly identifies which parameter is to blame, picking the
leftmost parameter that has (legal) extra const qualifiers, instead of picking
the actual parameter at fault.

Steps to Reproduce:
-------------------

Compile the attached file using: clang++ -std=c++11 -Wall main.cc

Actual Results:
---------------

    main.cc:7:9: error: out-of-line definition of 'hash' does not match any
declaration in 'hasher'
    ...
    main.cc:3:19: note: type of 1st parameter of member declaration does not
match definition ('const char *' vs 'const char *const')

Expected Results:
-----------------

    main.cc:7:9: error: out-of-line definition of 'hash' does not match any
declaration in 'hasher'
    ...
    main.cc:3:32: note: type of 2nd parameter of member declaration does not
match definition ('long &' vs 'const long &')

Build Date & Platform:
----------------------

Clang 3.6.0 (tags/RELEASE_360/final) on Ubuntu 14.04.2. (Also reproduced with
Clang 3.5.0 and earlier versions.)

-- 
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