You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A conversion that promotes an enumeration whose underlying type is fixed to its underlying type is better than one that promotes to the promoted underlying type, if the two are different.
Therefore, in the following program, the overload resolution should choose the int bar(short) overload.
This is indeed the case for GCC, but Clang reject the program, saying
error: call to 'bar' is ambiguous
The situation is the same when the underlying type of E is char.
What to do
fill a bug report for clang
test the C++ semantics
Unfortunately, the Clang parser rejects the above program as well. I can see two ways to test the semantics:
Make sure the clang parser outputs kast earlier in the pipeline, before overload resolution happens in Clang. However, this probably goes against our attempt to let the parser emit implicitly-defined functions and template specializations.
Create a manual test case, consisting of two files: test.C.ignore with the source code of the example, and test.C.kast with hand-crafted KAST. The kcc script would be run the test.C.kast file and skip the parsing part.
Btw we should add references to the standard even to our test files.
The text was updated successfully, but these errors were encountered:
Problem description
12.3.3.2/4.2 says:
Therefore, in the following program, the overload resolution should choose the
int bar(short)
overload.This is indeed the case for GCC, but Clang reject the program, saying
The situation is the same when the underlying type of
E
ischar
.What to do
Unfortunately, the Clang parser rejects the above program as well. I can see two ways to test the semantics:
test.C.ignore
with the source code of the example, andtest.C.kast
with hand-crafted KAST. Thekcc
script would be run thetest.C.kast
file and skip the parsing part.Btw we should add references to the standard even to our test files.
The text was updated successfully, but these errors were encountered: