Skip to content

#include <iostream> makes it impossible to use pipe as a variable name #79782

Closed
@hewillk

Description

@hewillk
#include <iostream>

int pipe;

https://godbolt.org/z/fqPhTzq1E
The latest libc++ rejects the above code with:

<source>:3:5: error: redefinition of 'pipe' as different kind of symbol
    3 | int pipe;
      |     ^
/usr/include/unistd.h:437:12: note: previous definition is here
  437 | extern int pipe (int __pipedes[2]) __THROW __wur;
      |            ^
1 error generated.

Note that Clang-17's libc++, libc++, and MSVC-STL accept it.

Metadata

Metadata

Assignees

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions