Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3319828
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:52:14+00:00 2026-05-17T22:52:14+00:00

$10.2/4- [ Note: Looking up a name in an elaborated-type-specifier (3.4.4) or base-specifier (Clause

  • 0

$10.2/4- “[ Note: Looking up a name in
an elaborated-type-specifier (3.4.4)
or base-specifier (Clause 10), for
instance, ignores all nontype
declarations, while looking up a name
in a nested-name-specifier (3.4.3)
ignores function, variable, and
enumerator declarations.”

I have found this statement to be very confusing in this section while describing about name lookup.

void S(){}

struct S{
   S(){cout << 1;}
   void f(){}
   static const int x = 0;
}; 

int main(){ 
   struct S *p = new struct ::S;  // here ::S refers to type
   p->::S::f();

   S::x;  // base specifier, ignores the function declaration 'S'

   ::S(); // nested name specifier, ignores the struct declaration 'S'.
   delete p;
} 

My questions:

  1. Is my understanding of the rules correct?

  2. Why ::S on the line doing new treated automatically to mean struct S, whereas in the last line ::S means the functions S in the global namespace.

  3. Does this point to an ambiguity in the documentation, or is it yet another day for me to stay away from C++ Standard document?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:52:14+00:00Added an answer on May 17, 2026 at 10:52 pm

    Q1: I think so.

    Q2: Compatibility with C. When you declare a struct in C, the tag name is just that, a tag name. To be able to use it in a standalone way, you need a typedef. In C++ you don’t need the typedef, that makes live easier. But C++ rules have been complicated by the need to be able to import already existing C headers which “overloaded” the tag name with a function name. The canonical example of that is the Unix stat() function which uses a struct stat* as argument.

    Q3: Standard reading is usually quite difficult… you need to already know that there is no place elsewhere modifying what you are reading. It isn’t strange that people knowing how to do that are language lawyer…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: If possible, I am looking for a pure SQL query solution so I
I'm looking for a simple C# script that will export an SVN folder. note:
I'm looking for an XSD Documentation Generator for .NET. Please, provide any references. Note:
UPDATE : My original question wasn't quite clear. I'm looking for the name of
Note: I've read this and its not quite what I'm looking for: I have
Been looking for a solution for a long while now, but still no success,
[NOTE:I am really looking for some good debugging techniques here. Perhaps some tricks or
NOTE: I am trying to find the name of the specific LRU algorithm, not
By looking at the name of this directive one may think that magic_quotes are
I'm looking for the name of the PHP function to build a query string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.