Bug 111553 - Incorrect visibility of std::format
Summary: Incorrect visibility of std::format
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 13.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-23 16:52 UTC by Richard Kellnberger
Modified: 2023-10-05 09:12 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Kellnberger 2023-09-23 16:52:33 UTC
Using
g++ a.cpp -std=c++20
the following compiles successfully even so it should not.

#include <format>

int main(int argc, char* argv[]) {
	std::string a("a");
	return format("a{}", a)!="aa";
}

Passing an int, float, bool or a string literal to format instead raises the correct not declared error.
Comment 1 Andrew Pinski 2023-09-23 16:55:38 UTC
This is how the standard argument depedent lookup works ...
Comment 2 Jonathan Wakely 2023-10-05 09:12:43 UTC
This is now documented as not-a-bug:
https://gcc.gnu.org/bugs/#nonbugs_cxx