Bug ID: 37030
           Summary: Clang-cl confuses variable method with class
                    constructor when named the same, within noexcept(...)
           Product: new-bugs
           Version: 6.0
          Hardware: PC
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs

Created attachment 20168
Example of bug


When trying to automatically determine if a templated method is noexcept,
clang-cl confuses an argument's method for the class's constructor when named
the same. It also seems to be unable to find the variable's method. It's
easiest to refer to the simple example I've created, see attached.

Steps to Reproduce

Compile the example main.cpp file with clang-cl, no extra switches required.

Actual Results

When compiling main.cpp with clang-cl, a warning and two errors are produced.

Line 17 warning: explicit constructor calls are a Microsoft extension. It
appears that the compiler is mistaking `bar()' part of `' for the
constructor for the class `bar'.

Line 17 error: no member named 'bar' in 'A': This isn't true, there is a member
`bar' in `A'.

Line 17 error: no member named 'bar' in 'B': This isn't true, there is a member
`bar' in `B'.

Expected Results

A working binary.

Build Date & Hardware

Windows 7 Clang-cl 5.0.1 64-bit from

Additional Builds and Platforms

MacOS 10.12.6, Clang-cl 5.0.1 and 6.0.0 from macports has this bug as well. I
don't quite know how clang-cl exists on MacOS, but it does.

Additional Information

Clang (on MacOS) and clang++ do not have this issue and produce working
binaries when using the flag -std=c++11.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to