Skip to content

Possible false positive in undefined-inline with __alloctr_rebind_helper #21082

@Axel-Naumann

Description

@Axel-Naumann
Bugzilla Link 20708
Version trunk
OS Linux
Attachments excerpt from libstdc++ 4.9.1/bits/alloc_traits.h; reproducer
CC @DougGregor

Extended Description

Hi,

with the attached file.h (excerpt of bits/alloc_traits.h from libstdc++ of GCC 4.9.1) and clang r212179 I get

$ clang -Wall -fsyntax-only -x c++ -std=c++11 file.h
file.h:28:3: warning: inline function '__alloctr_rebind_helper<int, float>::_S_chk<int, float>' is not defined [-Wundefined-inline]
                _S_chk(...);
                ^
file.h:31:32: note: used here
              using __type = decltype(_S_chk<_Alloc, _Tp>(nullptr));
                                      ^
1 warning generated.

I don't think decltype should require a definition; I don't see how a definition could change the decltype. It compiles just fine without the warning.

As I said this happens in the wild with libstdc++ of GCC 4.9.1 (installed side by side to the system compiler version) - where we still need to figure out why clang thinks they are not system headers. But that shouldn't affect this issue.

Thanks!

Axel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions