https://bugs.llvm.org/show_bug.cgi?id=37030
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
Assignee: unassignedb...@nondot.org
Reporter: jtfreder...@hrl.com
CC: llvm-bugs@lists.llvm.org
Created attachment 20168
--> https://bugs.llvm.org/attachment.cgi?id=20168&action=edit
Example of bug
Overview
========
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 `t.bar()' 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 http://releases.llvm.org/download.html.
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
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs