14

This question covers the . According to wikipedia, the term was coined by Scott Meyers in Effective STL. Pedants will say that the "most vexing parse" refers to a specific form of ambiguity resolution of the form:

std::ifstream ifs("file.txt"); 
std::vector<T> v(std::istream_iterator<T>(ifs), std::istream_iterator<T>());

And not:

MyObject  object();  // error

It's defined formally in §6.8 Ambiguity Resolution of the C++ standard(s). There is no mention of the "most vexing parse"1. But it's popularly used to refer to any form of syntactic ambiguity where an expression-statement is interpreted as a declaration.

I don't know the history of Default constructor with empty brackets, but judging from the revision history I suspect this happened:

  • The tag was created somewhere around 2009. The tag wiki uses a correct example of the "most vexing parse".

  • The answerer calls it the "most vexing parse" and the question is retroactively tagged.

  • Because the question is useful/popular, it was tagged as an FAQ 3 years later.

The title could use some reworking as well as it's hopelessly vague.

I can currently think of 3 approaches:

  • Don't do anything, pedants will be pedants and the nomenclature reflects the usage.

  • Clean up the FAQ question.

  • Create a new FAQ question that specifically addresses §6.8, so that we have a canonical question and not confusing scattered bits and pieces.

Then perhaps a new tag could be created, something like and questions that don't specifically address the "most vexing parse" could be retagged.


1 It should probably be called the "arbitrarily vexing parse" or "ambiguously vexing parse" instead.

9
  • 7
    Why would anyone who knows enough to use the tag need to ask a question about it?
    – bmargulies
    Mar 23, 2015 at 11:21
  • 4
    @bmargulies Seems like many of the questions were tagged retroactively. However, if someone is using the tag deliberately they're probably asking a language lawyer esque question.
    – user3920237
    Mar 23, 2015 at 11:29
  • 1
    How about object-construction or something if you really need a tag (and I honestly don't know why you do). There's nothing particularly vexing about it besides people failing to learn the language's basic syntax. Mar 23, 2015 at 18:42
  • The canonical MVP example is governed by §8.2 [dcl.ambig.res], not §6.8 [stmt.ambig]. For MyObject object(); there is no ambiguity in the grammar at all, which doesn't permit using () as an initializer in this context.
    – T.C.
    Mar 24, 2015 at 5:16
  • 1
    @T.C. The problem is people calling "MyObject object();" the most vexing parse. I'm proposing a separate FAQ question for §6.8.
    – user3920237
    Mar 24, 2015 at 11:48
  • 1
    I am confused, are we discussing about the canonical question, the tag, yet-another-topic? The tags of this question says "canonical" yet the answer is about the tag?
    – Braiam
    Mar 24, 2015 at 11:58
  • @Braiam The answerer has made it clear that they don't think a canonical question would be necessary, and burninating the tag would be a better option.
    – user3920237
    Mar 24, 2015 at 12:06
  • 2
    The problem is the question. What exactly is the topic of this discussion, the [tag] or the [canonical] question?
    – Braiam
    Mar 24, 2015 at 12:25
  • @Braiam I'm personally more in favor of just an FAQ question but it wouldn't make sense by itself unless you retagged some questions as well. It looks like another user has retagged some of the top questions.
    – user3920237
    Mar 24, 2015 at 12:48

1 Answer 1

43

This tag is useless regardless.

We might as well start tagging questions , ,

If somebody wants to know what the most vexing parse is, their question is a duplicate of the canonical question.

If somebody has an error and its due to the most vexing parse (or its non-vexing cousin, A x()) then their question is due to a "typo" of sorts and can no longer be reproduced. Thus, it should be closed as such. The OP simply and trivially used the wrong syntax by not reading their book properly.

I just can't see any use for tagging such questions, and the fact that people keep misusing it also makes me want to see it go.

Nuke it.

4
  • Agreed, tags should be used to allow people to follow a dedicated stream of questions; who would be interested in following most vexing parse questions oO ? Mar 24, 2015 at 12:36
  • 5
    I am a most vexing expert! Err... um... wait a moment. Let me reconsider that statement.
    – user289086
    Mar 24, 2015 at 19:36
  • 2
    -1... I don't think a question should be closed just because the OP used the most vexing parse.
    – user541686
    Mar 24, 2015 at 20:37
  • 3
    @Mehrdad: Why not? You want a million useless duplicates of silly syntax errors? What's the point in that? Mar 25, 2015 at 10:47

You must log in to answer this question.