Warning, possible error, in name mangling

As I'm compiling with MSVC I am possibly seeing a different set of warning
to the majority.

As a starter, the following if-test gets the warning:

warning C4806: '==' : unsafe operation: no value of type 'bool' promoted to
type 'clang::SrcMgr::CharacteristicKind' can equal the given constant

...\llvm\tools\clang\lib\CodeGen\Mangle.cpp line 99

The code in question:

  } else if (// C functions are not mangled
             !Context.getLangOptions().CPlusPlus ||
             // "main" is not mangled in C++
             FD->isMain() ||
             // No mangling in an "implicit extern C" header.
             (FD->getLocation().isValid() &&

Context.getSourceManager().getFileCharacteristic(FD->getLocation()))
               == SrcMgr::C_ExternCSystem ||
             // No name mangling in a C linkage specification.
             isInCLinkageSpecification(FD))
    return false;

It looks to my untrained eye that the following extract has a misplaced
close-paren:

             (FD->getLocation().isValid() &&

Context.getSourceManager().getFileCharacteristic(FD->getLocation()))
               == SrcMgr::C_ExternCSystem ||

Which I *think* should be

             (FD->getLocation().isValid() &&

Context.getSourceManager().getFileCharacteristic(FD->getLocation())
               == SrcMgr::C_ExternCSystem) ||

but that is reading between the lineds of what identifiers are likely to
mean without understanding the code.

Should I open a bug report, or is this simply noise?

Note that I'm not in a position to produce a test case as I'm acting purely
on source code warnings without understanding the actual functionality -
hence the danger of a false positive.

[Note this warning is actually the least of my worries but easiest to report
- most of the noise is ~5000 operator-new overloaded without matching
operator delete overload, which I am hope to investigate properly]

AlisdairM

As I'm compiling with MSVC I am possibly seeing a different set of warning
to the majority.

As a starter, the following if-test gets the warning:

warning C4806: '==' : unsafe operation: no value of type 'bool' promoted to
type 'clang::SrcMgr::CharacteristicKind' can equal the given constant

This definitely looks like a bug. Anders, this was introduced in r72671, what do you think?

-Chris

13 jun 2009 kl. 14.23 skrev Chris Lattner:

As I'm compiling with MSVC I am possibly seeing a different set of warning
to the majority.

As a starter, the following if-test gets the warning:

warning C4806: '==' : unsafe operation: no value of type 'bool' promoted to
type 'clang::SrcMgr::CharacteristicKind' can equal the given constant

This definitely looks like a bug. Anders, this was introduced in r72671, what do you think?

-Chris

Yup, looks like a bug to me!

Anders

Fixed in r73311

-Chris