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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:56:32+00:00 2026-05-24T15:56:32+00:00

As a follow-up to What is this crazy C++11 syntax ==> struct : bar

  • 0

As a follow-up to ” What is this crazy C++11 syntax ==> struct : bar {} foo {};? “, I’d expect the following C++0x code to compile:

struct x {};
struct :::x {} y {};

However, GCC 4.7.0 20110731 tells me:

error: global qualification of class name is invalid before ‘:’ token

And when I take a step back towards sanity and give the second UDT a name:

struct x {};
struct a:::x {} y{}; // remember, identical to `a::: x` or `a: ::x` or `a:: :x` etc

the error is:

error: ‘a’ has not been declared


It seems like the three colons are being lexed like <::> <:> rather than <:> <::>, but can this clearly be deduced from the [final draft] standard?

And might the question ” Global qualification in a class declarations class-head ” be related?

  • 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-24T15:56:33+00:00Added an answer on May 24, 2026 at 3:56 pm

    This is just to do with parsing. From §2.5.3

    If the input stream has been parsed into preprocessing tokens up to a given character, the next preprocessing token is the longest sequence of characters that could constitute a preprocessing token, even if that would cause further lexical analysis to fail.

    Basically, it has to take the longest sequence of characters, so ::: is always parsed as :: : in the same way that x+++y is always parsed as x ++ + y.

    This is referred to as Maximal Munch parsing.

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

Sidebar

Related Questions

I follow this tutorial to parse multipart request. To this code in first line
This is making me a bit crazy. I have the following Application: Activity A
I follow this tutorial online exactly but somehow it's giving me errors. Saying there
I follow this rule but some of my colleagues disagree with it and argue
I just follow this DIHQuickStart , try to import data to solr from mysql.
Sorry to follow this topic http://stackoverflow.com/questions/11044825/javascript-run-on-ie-7 I want to use document.GetElementByClassName ON INTERNET EXPLORE
I am tring to follow this post post and combine it with the ShootThemUp
I am trying to follow this article to do the same for adding a
I'm trying to follow this tutorial using StructureMap : http://iridescence.no/post/Constructor-Injection-for-ASPNET-MVC-Action-Filters.aspx What I'm trying to
I'm trying to follow this documentation on Symfony : http://symfony.com/doc/current/book/forms.html ok so here is

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.