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 8444051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:18:17+00:00 2026-06-10T09:18:17+00:00

I tested on two compilers, and was surprised to see both support the following

  • 0

I tested on two compilers, and was surprised to see both support the following definition without complaint:

class A {
  A();
};

A::A::A() {}
   ^^^

Note that this also succeeds for methods, although it is flagged when the declaration is over-qualified.

Questions:

  • Is this a valid C++ program?
  • If so, what purpose does it serve – or is it merely a byproduct?

Updated Detail:

In case the original question was not clear or too short: I’m curious why redundant qualifications are permitted on the definition (emphasis also added above).


Clang an Apple’s GCC 4.2 + LLVM were the compilers

  • 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-06-10T09:18:19+00:00Added an answer on June 10, 2026 at 9:18 am

    Yes, it’s allowed (§9/2):

    The class-name is also inserted into the scope of the class itself; this is known as the injected-class-name. For purposes of access checking, the injected-class-name is treated as if it were a public member name.

    For information about the reasoning that lead to class name inject, you might want to read N0444.

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

Sidebar

Related Questions

I tested this on both .Net 4.0 and .Net 4.0 CP, same result. This
I have two programs written in C++ that use Winsock. They both accept TCP
Consider the following (tested with Scala 2.8.1 and 2.9.0): trait Animal class Dog extends
So I am trying to put two inline dropdown lists. I tested and it
Has anyone ever tested, or does anyone know, the performance differences of these two
I tested the following code in firefox scratchpad and got interesting result? var date=new
I tested the behavior of copy constructor with functions that return an object by
i tested HttpResponse#flushBuffer and PrintWriter#flush on Tomcat 7 below, but it seemed that the
In C++, assume following class hierarchy: class BaseClass { }; class ChildClass : public
I have two scenarios. Suppose I have 3 shared libraries that export C++ symbols,

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.